excel saving exception in vc code

  • Thread starter Thread starter onlyfang
  • Start date Start date
O

onlyfang

I save a excel file using vc code, when the file is aready exsited, a
dialogue box appears with three choices--yes, no or cancel--for me to decide
whether to cover the exsited file or not. If I choose yes, it runs well. But
when I choose ¡°no¡± or ¡°cancel¡±, an exception happens--a messagebox
without any words appeares and the excel file doesn¡¯t exit.

Why does this happen? Can anyone help me?
 
Do you always want to save the file?

Application.displayalerts = false
'your code to save the workbook
application.displayalerts = true
 
Oh, thank you very much, Dave! The problem has been solved!
Yes, i always want to save the file, and the counterpart code in vc is
"Application.SetDisplayAlerts(false)".
Thank you!

Dave Peterson said:
ps. I don't speak the VC code. You'll have to interpret it.
 
Back
Top