Is there any api for executing a macro code on an excel? I don't want to use office interop and I don't want to recode using aspose, I have lot of existing macros I just want to know if there's an api that can do that.
-
How do you plan to have a reference to the workbook without office interop or aspose? You need to load it in memory somehow...phoog– phoog2011-04-08 15:31:35 +00:00Commented Apr 8, 2011 at 15:31
-
yea so that api should be able to do that as well. thats self evident though.n12345– n123452011-04-08 15:55:28 +00:00Commented Apr 8, 2011 at 15:55
-
I suspect the answer then is no.phoog– phoog2011-04-08 16:32:01 +00:00Commented Apr 8, 2011 at 16:32
Add a comment
|
2 Answers
Are you looking to do it in .NET? There are programs for that. Like XLW, Managed XLL, Excel-DNA, Add-in Express, VSTO, etc.
1 Comment
n12345
I guess all these help write code in .net instead of vba, aspose does the same. But I'm talking about executing existing vba code from .net without using office interop excel.exe instance intialization.
To run a macro, you must create an environment in which the macro can run. To create such an environment you need to automate Excel. You can do this in an Excel add-in or in a standlone application in .NET or in Delphi, VB6, VC++ or other language. After you instantiate the Excel.Application object, you need to call the method it provides - RunMacro.