vsto to fill data use listobject fill
public void btnFormatTables(Office.IRibbonControl control) { var sheet = (InteropExcel.Worksheet)Globals.ThisAddIn.Application.ActiveSheet; var vstoSheet = Globals.Factory.GetVstoObject(sheet); var vstoListObject = vstoSheet.Controls.AddListObject(vstoSheet.Range["A1", "B3"], "list1"); var table = new System.Data.DataTable("Employees"); table.Columns.Add("FirstName", typeof(string)); table.Columns.Add("LastName", typeof(string)); table.Columns.Add("Title", typeof(string)); table.Rows.Add("Nancy", "Anderson", "Sales Representative"); table.Rows.Add("Robert", "Brown", "Sales Representative"); vstoListObject.AutoSetDataBoundColumnHeaders = true; vstoListObject.SetDataBinding(table, "", "Title", "LastName", "FirstName"); vstoListObject.Disconnect(); }
-----------------------------------
http://www.cnblogs.com/rock_chen/