12-13-2019 04:31 AM
Hello everyone.
Firstly I program on CVI 2010 and to control excel I use "Microsoft Excel 9.0 Objet Library".
I have to write data on variable number of worksheets automaticly without user interact. For that I have make a template with the maximum sheet (it's 10) and I delete all unused sheet. You can see my program below.
for (i = 10 ; i > nb_sheet; i--) {
Excel_SheetsItem (ExcelSheetsHandle, NULL, CA_VariantInt(i),
&ExcelWorksheetHandle);
Excel_WorksheetDelete (ExcelWorksheetHandle, NULL);
ClearObjHandle (&ExcelWorksheetHandle);
}
The problem is when I delete a sheet, Excel pop-up appears to validate this action.
It's possible to deseable all Excel pop-up directly with a activeX commande or I need to lanch a VBA macro to do this job ?
Thanks a lot.
Esteban
12-14-2019 12:39 PM
Deleting a worksheet with data causes that confirmation. Perhaps you can delete all the data first? Or (assuming your template worksheets are identical) copy a single template worksheet with Excel_WorksheetCopy when you need one rather than starting with 10.