views:

500

answers:

1

Can I create a macro written in C# for Excel that allows me to export a cell's data to a SQL Server or Access database?

Basically, I'd like to create a button in Excel that saves the data in certain cells to a database. Can this be done?

Instead of creating a UI from scratch for a program, I've decided using Excel as the user environment would be better for business needs.

+1  A: 

How to automate Excel by using Visual C# to fill or to obtain data in a range by using arrays would be a good starting point.

Be aware, you're going to find it frustrating to control what people attempt to enter into the Excel sheet, as the inherit flexibility of the data works again your efforts to write it to a database destination.

Derek B. Bell