views:

363

answers:

1

Hi,
I'm really new to VSTO so sorry if this is a newbie question.

I'm working on a data entry application where I need to have the user get data into an excel table (e.g. when you highlight a bunch of rows and click "Format As Table"), then I need to read the data in from that table and work with it in C#.

At a basic level, I've got a schema in C# in some format. I need to create a table in Excel in that format (Column Names + Validation rules on the types. Some of the types are enums so I presume I need to create a list on another sheet with all enum values and specify that list for the binding). Once the table is created, the user goes about entering data, and when they close excel, I read the data out. I've figured out how to do this with just raw cells, but I haven't been able to create tables or validation rules. Any ideas?

Also, where can I find some good resources on excel VSTO programming?

Thanks,
Roy

+1  A: 

After much investigation, I've found the best way to be using the SetDataBinding Method inside of ListObject. Here is an example: ListObject.SetDataBinding

And for using Enums, I found documentation on the Validation methods here: Excel Validation

LPCRoy