Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

Overriding confirm dialog while saving an Excel file

$
0
0

I am writing an application that exports data to an Excel sheet by means of excel2000 instrument.I want to be able to suppress confirmation dialog box while saving a file over an existing one. The background is that the filename is choosen by the operator with FileSelectPopupEx, so if the file already exists the function automatically asks for a confirmation before exiting so an additional same dialog is annoying.

 

Based on this MSDN page, I experimented with ConflictResolution parameter in Excel_WorkbookSaveAs to no avail: the line I am using is this one but it keeps prompting me a confirmation dialog if the file already exists:

	errChk (Excel_WorkbookSaveAs (ExcelWorkbookHandle, NULL, MyVariant, CA_DEFAULT_VAL,
				CA_DEFAULT_VAL, CA_DEFAULT_VAL, CA_DEFAULT_VAL, CA_DEFAULT_VAL,
				ExcelConst_xlNoChange, CA_VariantInt (ExcelConst_xlLocalSessionChanges),
				CA_DEFAULT_VAL, CA_DEFAULT_VAL, CA_DEFAULT_VAL));

Based on this post by kirkm I found that calling

	errChk (Excel_SetProperty (ExcelAppHandle, NULL, Excel_AppDisplayAlerts, CAVT_BOOL, VFALSE));

I can suppress the dialog, but it suppresses all alerts that could be raised and it seems excessive to me. I wonder if anyone succeeded in hiding the dialog in Save As call.


Viewing all articles
Browse latest Browse all 5339

Trending Articles