Unable to copy sheets in Excel from VC++
I am ABSOLUTELY UNABLE to copy sheets in my COM Excel in Visual C++. Otherwise it works quite fine, I can open files, write to them, save, format, etc. etc. but copying sheets is beyond my abilities. It is however extremely important for me to be able to do it!!
pXL->Visible = VARIANT_TRUE;
WorkbooksPtr books = pXL->Workbooks;
pBook = books->GetItem("VZOR21.XLS");
sheets = pBook->GetSheets();
//all this works but
nor anything similar does not work and I do not know why!! There are sheets "1" and "2" (and many others) in the file, so WHY?? I am able to compile it but running it always ends with an exception.
If somebody were able to help me, I would be EXTREMELY GRATEFUL. THANKS A LOT!!!