button-state in Excel Save-As-Dialog

daniel_green

New Member
Hey everybody!

I HAVE A BIG PROBLEM!

I want to save a Excel-File and therefor I use the command
chWorksheet:SaveAs("myExcel1.xlc").
and it works fine. :)

But if the file already exists, a new dialog will pop-up and describes that the file already exists and that I should press one button (yes,no,cancel).

AND HERE IS MY PROBLEM: :mad:
I want to know which button was pressed.

I've tried this command:
def var butState as char init ?.
butState = chWorksheet:SaveAs("MyExcel1.xlc").

if button "YES" was pressed then butState = 1.
if button "NO" or "CANCEL" was pressed then butState = ?.

So my question is: is there any solution so that I can distinguish between NO and CANCEL????? :confused:


Thanks for your circumstances
Daniel
 

dancar

Member
dialog

Cancel is set to "FALSE" this from HELP.

SYSTEM-DIALOG GET-FILE Statement -- PARAMETERS

MUST-EXIST

Requires that the user's filename entry, complete with any specified default extension, must exist in the directory specified for the filename entry before the dialog completes. If it does not exist, the dialog displays an error message and prompts for another filename entry. The dialog does not complete until the user enters the name of an existing file or chooses the Cancel button to interrupt the dialog.

UPDATE logical-variable

Specifies a logical variable to return the status of the user's filename dialog interaction. If the user chooses the OK button, the dialog sets logical-variable to TRUE. If the user chooses the Cancel button, the dialog sets logical-variable to FALSE.
 
Top