2

I am looking for a .Net spreadsheet component that could also execute the VBA contained in Excel files.

I found Spreadsheet Gears to be very nice for manipulating and allowing the user to edit Excel files, but on spreadsheets that use VBA for calculations, well, these don't work.

So, apart from Excel itself, are there any other components that can execute VBA?

Renaud Bompuis
  • 16,596
  • 4
  • 56
  • 86
  • I don't know about VBA, but there is (or was) a .NET component that would execute VBScript. I used it with .NET 2.0. The syntax is very similar, and it might work for code that doesn't need tight integration with a specific workbook (like a function library or something). – jtolle May 19 '10 at 14:58
  • SpreadsheetGear will not execute your VBA code, but you can implement your user defined functions in C# or VB.NET and your workbooks will work with SpreadsheetGear. See the "Custom Functions" sample on this page for an example: http://www.spreadsheetgear.com/support/samples/calcengine.aspx – Joe Erickson May 20 '10 at 15:38

1 Answers1

1

You can directly execute office macros from .NET

Eg: vb.net

 objExcel = New Excel.Application
 objExcel.Workbooks.Open(FileName:="c:\test.xls", ReadOnly:=True)
 objExcel.Run("test.xls!test.test")
Konstant
  • 2,179
  • 16
  • 32