A
Alexei
Hi,
Using VC 7.0 with excel 2000
COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
CApplication app;
app.CreateDispatch( _T("Excel.Application") );
CWorkbooks books = app.get_Workbooks();
CWorkbook book = books.Add(covOptional);
books.get_Item(COleVariant(short(1)));
CWorksheets sheets = book.get_Sheets();
CWorksheet sheet = sheets.get_Item(COleVariant((short)1));
long lSheetCount = sheets.get_Count();
ASSERT ( 3 == lSheetCount ); // default quantity
// trying to use Add, but it failed:
sheets.Add( COleVariant(short(2)), COleVariant(short(2)),
COleVariant(short(1)), COleVariant(short(3)) ); // last param is type.
what should I put here?
Using VC 7.0 with excel 2000
COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
CApplication app;
app.CreateDispatch( _T("Excel.Application") );
CWorkbooks books = app.get_Workbooks();
CWorkbook book = books.Add(covOptional);
books.get_Item(COleVariant(short(1)));
CWorksheets sheets = book.get_Sheets();
CWorksheet sheet = sheets.get_Item(COleVariant((short)1));
long lSheetCount = sheets.get_Count();
ASSERT ( 3 == lSheetCount ); // default quantity
// trying to use Add, but it failed:
sheets.Add( COleVariant(short(2)), COleVariant(short(2)),
COleVariant(short(1)), COleVariant(short(3)) ); // last param is type.
what should I put here?