Hi all
In vb I do:
Dim Ex As New Excel.Application
Ex.Workbooks.Open "c:\tmp\Book1.xls"
Similar code in VC doesn't work:
#pragma comment(lib, "ole32.lib")
#import "c:\program files\Microsoft Office\OFFICE11\XL5EN32.OLB"
rename("DialogBox","__AA__")
/* ... */
Excel::ApplicationPtr app(L"Excel.Application");
((Excel::WorkbooksPtr)app->Workbooks())->Open(_variant_t("c:\\tmp\\Book1.xls"));
Index is wrong - yes because we didn't open Workbook yet
How to eliminate/fix/bypass this error
Or may be it should be different way to open Excel workbook in VC?
Best regards,
Vasiliy
www.fruitfruit.com - 25 Jul 2006 09:11 GMT
There is a little difference between VC and VC. Refer to some code
snippets here
http://www.fruitfruit.com/vc/activex/excelauto.cpp
> Hi all
>
[quoted text clipped - 22 lines]
> Best regards,
> Vasiliy
k-w - 26 Jul 2006 14:31 GMT
thank you very much - very helpful
Best regards,
vasiliy
> There is a little difference between VC and VC. Refer to some code
> snippets here
[quoted text clipped - 26 lines]
> > Best regards,
> > Vasiliy