spano

Is it possible to use the items, controls and data binding support in the Microsoft.Office.Tools.Excel namespace in an Excel 2007 addin created with VSTO SE

I want to migrate a document-customization project for Excel 2003 to Excel 2007 but I see there is no document-customization project template in VSTO SE. Only the application level addin template is available.

By using this addin, I get to the Excel Application object...but how can I use the ListObject data binding, or the NamedRange objects Is it possible Or I have to access the cells using the interop objects

Besides, there is a way I can check the active workbook is based on a particular Excel Template

Thanks in advance,

Sole



Re: Visual Studio Tools for Office Microsoft.Office.Tools.Excel Items and controls in Excel 2007 with VSTO SE

Dennis Wallentin

Hi spano,

I want to migrate a document-customization project for Excel 2003 to Excel 2007 but I see there is no document-customization project template in VSTO SE. Only the application level addin template is available.

That's correct however You can use a workbook level solution created with VSTO 2005 & Excel 2003 with Excel 2007.

By using this addin, I get to the Excel Application object...but how can I use the ListObject data binding, or the NamedRange objects Is it possible Or I have to access the cells using the interop objects

Since none of the objects (ListObject and NamedRange) are persisted You need to access the cells through the interop objects. But it's possible to create a ListObject, populate it with data and then disconnect the ListObject from the range (see http://xldennis.wordpress.com/2007/05/08/csv-files-listobject-controls-and-vsto/). This approach speeds up things when retrieving data from databases and to populate worksheets.


Besides, there is a way I can check the active workbook is based on a particular Excel Template

One way is to use the collection CustomDocumentProperties.






Re: Visual Studio Tools for Office Microsoft.Office.Tools.Excel Items and controls in Excel 2007 with VSTO SE

spano

Thanks Dennis, very helpful!





Re: Visual Studio Tools for Office Microsoft.Office.Tools.Excel Items and controls in Excel 2007 with VSTO SE

spano

Dennis, one more question about the ListObject. When you said: "It's possible to create a ListObject, populate it with data and then disconnect the ListObject from the range (see http://xldennis.wordpress.com/2007/05/08/csv-files-listobject-controls-and-vsto/)." you mean that it is possible to create a Microsoft.Office.Tools.Excel.ListObject The link you make reference talks about this vsto list object, created by using the Microsoft.Office.Tools.Excel.Worksheet.Controls.AddListObject method. But, since I don't have any Microsoft.Office.Tools.Excel.Worksheet in the VSTO SE Excel application-level add-in, how can I create a Microsoft.Office.Tools.Excel.ListObject

On the other hand, if I use the Microsoft.Office.Interop.Excel.ListObject, to which I do have access, I lack of the data binding capabilities.