Calling the Dialog Box Forms of Functions

In the macro language, most command equivalents that have dialog boxes can be called either with the dialog box or without. In the dialog box form of the function, the name is followed by a question mark. For example, SAVE.AS will not prompt the user with a dialog box, but SAVE.AS? will. To use the dialog box form in C, simply set the xlPrompt bit (defined in XLCALL.H). For example, this code deletes the file BOOK1.XLS:

XLOPER xResult, xBook1;

xBook1.xltype = xltypeStr;
xBook1.val.str = "\011BOOK1.XLS";

Excel4(xlcFileDelete, &xResult, 1, (LPXLOPER)&xBook1);

The following code displays the Delete dialog box, offering all the *.BAK files as candidates for deletion:

XLOPER xResult, xFilter;

xFilter.xltype = xltypeStr;
xFilter.val.str = "\005*.BAK";

Excel4(xlcFileDelete | xlPrompt, &xResult, 1, (LPXLOPER) &xFilter);