Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.sdk,microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd do this in VBS:
Dim xlApp Dim xlAddin Dim xlWks Set xlApp = CreateObject("Excel.application") xlApp.Visible = True Set xlAddin = xlApp.workbooks.Open("C:\youraddinnamehere.xla") Set xlWks = xlApp.workbooks.Open("C:\yourcvsfilenamehere.csv") .worksheets(1) xlApp.Run "'" & xlAddin.Name & "'!yourmacronamehere" 'and if you want to close things... 'xlWks.Parent.Close False 'cancel changes to .csv file 'xlAddin.Close False 'cancel changes to addin 'xlApp.Quit ' 'Set xlWks = Nothing 'Set xlAddin = Nothing 'Set xlApp = Nothing ====== ps. I'm assuming that a macro template is an addin. Rob Y wrote: Well, I found some sample code that shows me how to do OLE automation of Excel. The funny thing is that I can't for the life of me find any documentation on what API's Excel offers for OLE automation. Even the guy who wrote the sample code said that he figured out what calls to make by recording macros and guessing based on the macro listings. Is that weird or what? Maybe I'm just looking in the wrong places. Or maybe there's a standard way to map from XLL API's (well documented) to OLE-callable stuff. Does anybody know where to find documentation and/or code samples? Again, specifically, I want to 1. Launch Excel. 2. Load up a macro template. 3. Load up a csv data file. 4. run a macro in the template. Sounds pretty straightforward, no? Thanks, Rob -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to bypass Open macro when launching Excel 2003 | Excel Programming | |||
Launching Excel macro for every workbook opened. | Excel Programming | |||
macro to operate in protected cells | Excel Programming | |||
Launching Excel programmatically not the same as launching excel manually | Excel Programming | |||
launching excel, a file, and a macro automatically | Excel Programming |