Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.sdk,microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default launching Excel with a macro to operate on CSV data?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to bypass Open macro when launching Excel 2003 Andre Lavoie Excel Programming 1 April 5th 06 08:08 PM
Launching Excel macro for every workbook opened. AbsoluteZero Excel Programming 1 December 15th 05 06:21 PM
macro to operate in protected cells HGood Excel Programming 2 December 1st 04 09:11 PM
Launching Excel programmatically not the same as launching excel manually Atchoum Excel Programming 2 November 24th 04 06:24 PM
launching excel, a file, and a macro automatically Bernie Yaeger Excel Programming 0 September 16th 04 05:45 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"