Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call Excel from VC++ Win32 DLL
Hi
I am writing a VC++ Win32 DLL, and in one of the functions that I'm exporting I need to do the equivalent of the following VB code: Dim oExcelApp as Object ‘ oExcelApp gets set to Excel.Application in call to third party DLL oExcelApp.ActiveSheet.ChartObjects(1).CopyPicture In my VC++ project oExcelApp is declared as follows: IDispatch *pExcelApp; How can I implement the functionality in the VB code above in VC++? I've searched various news groups and MSDN and it seems that I have two choices: 1) use the #import directive (excel9.olb) 2) work with such APIs as CoCreateInstance(), and COM interfaces such as IDispatch I try the #import but I get loads of compilation errors, for example: error C2504: '_IMsoDispObj' : base class undefined With point 2, surely I still have to include some files to include references to Excel? Also I'm not sure how to even go about this. Please can someone give me step-by-step instructions on how to call Excel from VC++. Many thanks. Julia. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Win32 error on mixed office software | Excel Discussion (Misc queries) | |||
MS Excel Error - Win32 exception | Setting up and Configuration of Excel | |||
Call Center Management: How to calculate 'cost per call' | Excel Discussion (Misc queries) | |||
Not a valid Win32 file ? | Setting up and Configuration of Excel | |||
Call Excel from VC++ Win32 DLL | Excel Programming |