-
Notifications
You must be signed in to change notification settings - Fork 2
Home
FransVanEk edited this page Oct 16, 2014
·
2 revisions
Welcome to the ExcelViewModel wiki!
In your Add-in you can get a hold of the application from the static Globals object. In this example we will get the current workbook instance. After that we will be able te create a listobject in Excel, on a specific Worksheet ("First demo") with the name "FirstDemoData" starting on location "A1"
The data in the listobject comes from a simple method which creates al object wich implements the WannaApp.Excel.DataObjects.IListObjectDataObject interface.
private void btn_LoadListObject_Click(object sender, RibbonControlEventArgs e)
{
var workbook = new ExcelWorkbook(Globals.ThisAddIn.Application.ActiveWorkbook);
`var list = workbook.FindOrCreateWorksheet("First demo").CreateListObject("A1", GetData(), "FirstDemoData");`
`}`