Johan Nordberg


do you consider questions about custom definied schemas in Excel and XML databinding in VSTO off topic or is ok to ask about it here

Re: Visual Studio Tools for Office Are Excel XML questions off topic?

Cindy Meister

If the data-binding to which you refer is something offered by the VSTO technology (as opposed to something native to Excel and independent of VSTO), then it's on-topic and please ask :-)

Re: Visual Studio Tools for Office Are Excel XML questions off topic?

Johan Nordberg


I hope I can use the data binding feature that VSTO offers to Excel.

My client have a database with data for projects, time periods and data (a bit simplified, but it works). So lets say there's one Projects table and one Data-table which has a projectid, a date and the data value. The Data-table contains several rows for a singles project.

For presentation of the data they would like to use Excel. I'm proposing a VSTO solution with a custom task pane to browse projects and periods. When I select a project and a year I would like to bind weekly data to the excel sheet.

Using a ListObject this would be really easy if the data should be presented vertically, but this data should be displayed horizontally with one week in each column.

So, my question really is how do I best map either a named range or an XmlMapped Range to a filtered row in the result set or a xpath query in an xml file Is it possible to use data binding Some of the data should be changed and then written back to the database so it would be wonderful if databinding worked.

Also, I might need to create the worksheet at runtime.

The solution will target Excel 2003 Pro.

Re: Visual Studio Tools for Office Are Excel XML questions off topic?

Mohit Gupta - MSFT

Hi Johan.

I dont see you got an answer to your question yet. In the situation you describe, you can use data binding to a NamedRange object, if you have the result field of the query that you want to bind to available in a public property on an object. If you are able to create a custom class that can contain the results of the query, you can simply add a public property to expose the field, and then bind to the field.

Hope this helps