Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is wrong with the following code?
CoInitializeEx(NULL, COINIT_MULTITHREADED); int i(01); for(; i < argc; i++) { static MULTI_QI interfaces[01] = {&__uuidof(_Workbook), NULL, 00}; // i tried also IID_IDispatch, does not work either HRESULT code; wcout << _T("Trying to open file ") << argv[i] << _T(" ... "); // argv[01] == "sheet.xls" if(SUCCEEDED(code = CoGetInstanceFromFile(NULL, NULL, NULL, CLSCTX_ALL, STGM_READ, argv[i], 01, interfaces))) { cout << _T("opened.") << endl; interfaces-pItf-Release(); } else { wcout << _T("failed.") << endl; HandleCOMError(code); } // code returned is E_NOINTERFACE |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to work with Many Worksheets | Excel Worksheet Functions | |||
How Do I Tie Worksheets to one Work book? | Excel Worksheet Functions | |||
Have 2 worksheets work together | Excel Worksheet Functions | |||
Macro to work only on selected worksheets | Excel Discussion (Misc queries) | |||
UDF doesn't work in old worksheets | Excel Discussion (Misc queries) |