LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Excel worksheet without pop-up

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

0 Kudos
Message 1 of 2
(2,670 Views)

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.

0 Kudos
Message 2 of 2
(2,408 Views)