Page 1 of 1

XLS Saveas

Posted: Tue Feb 11, 2025 7:23 pm
by serge_girard
Hello,

I create XLS and when the sheet is ready and shown this command will ask to save:

Code: Select all

oSheet1:SaveAs("C:\folder\file.XLS") 
Then when I choose not to save I will give runtime error:

Code: Select all

Error WINOLE/1007 (0x800A03EC): SAVEAS
Parameter : [ 1] = C "C:\folder\file.XLS" (DOS Error -2147352567)
Called from TOLEAUTO:SAVEAS(0)
Is there a way to catch this error and ignore?

Greetings, Serge

Re: XLS Saveas

Posted: Wed Feb 12, 2025 10:05 am
by vagblad
Hi Serge,

You could try catching it with a sequence:

Code: Select all

BEGIN SEQUENCE WITH {|o| break(o)}
  oSheet1:SaveAs("C:\folder\file.XLS")
RECOVER
  Msgdebug("File not saved!")
  RETURN
END SEQUENCE

Re: XLS Saveas

Posted: Wed Feb 12, 2025 10:26 am
by serge_girard
Thanks, I try!

Re: XLS Saveas

Posted: Wed Feb 12, 2025 10:33 am
by serge_girard
It works fine!