Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating Office Apps (Excel) out of C/C++

Status
Not open for further replies.

drdad5727

Programmer
Feb 28, 2005
28
US
I need to automate Excel from C/C++ code. All the documentation I can find is for writing Excel AddIns. That's not really what I'm trying to do.

What I want to do is start Excel (the equivalent of
Code:
CREATEOBJECT("Excel.Application")
in VB) and then do stuff to it: create a workbook, populate it with data, etc.

Now I'd think that VB CREATEOBJECT would translate into a COM CoCreateInstance, but I can't find any CLSID, etc. to use.

Has anybody done something like this?
 
Well...

If all you want to do is create a spreadsheet and populate it with data, it isn't very difficult. You can create a file using \n and tabs to separate rows and columns, and save it as a .xls, then use ShellExecute to launch it in Excel. If you need to do more than that, hopefully someone else knows more than me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top