-
January 22nd, 2006, 11:24 AM
#1
A question on automating Excel from a C++ program
I've got an MFC program that I wrote using Visual C++ 6. I'd like that program to be able to modify an existing MS Excel spreadsheet by opening that spreadsheet and passing arguments to a VB macro stored within it. If it matters, the macro has the form:
Code:
Sub AddItem(ItemDesc As String, ItemCount As Integer)
' ... lots of stuff happens ...
End Sub
I haven't done anything like this before so am kind of at a loss as to where to begin. I don't need a lot of details; basically I just would like someone to tell me what I should start reading to figure out how to send commands to Excel from a C++ program. Thanks!
-
January 22nd, 2006, 01:08 PM
#2
Re: A question on automating Excel from a C++ program
Originally Posted by Smasher/Devourer
I've got an MFC program that I wrote using Visual C++ 6. I'd like that program to be able to modify an existing MS Excel spreadsheet by opening that spreadsheet and passing arguments to a VB macro stored within it. If it matters, the macro has the form:
Code:
Sub AddItem(ItemDesc As String, ItemCount As Integer)
' ... lots of stuff happens ...
End Sub
I haven't done anything like this before so am kind of at a loss as to where to begin. I don't need a lot of details; basically I just would like someone to tell me what I should start reading to figure out how to send commands to Excel from a C++ program. Thanks!
Hi Smasher, good to have ya back
maybe this thread can help you out: How to load an Excel file.
BTW where is exactly the problem? In activating the macro? Or just load Excel file using automation and control it?
Cheers
-
January 24th, 2006, 12:49 PM
#3
Re: A question on automating Excel from a C++ program
For an example of running a macro from VC see :
Excel Macro
Verere testudinem! (Fear the turtle)
Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein
Robots are trying to steal my luggage.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|