What do you do when DisplayAlert does not work in VBA?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Excel workbook that is created using VBA. I have set DisplayAlert
to False just before I save the Workbook. This does not seem to work as, the
Save Dialog Box keeps coming up. I do not want this because I want to
automate the whole process. Any suggestions?
 
Hi M. Hussaini

If you want to close the file after you save with VBA and not want to see Save Dialog Box
Then you can use this with code

ActiveWorkbook.Close False

If you have set a reference (WB ) to the file you can de
WB.Close False
 
Are you using this line? Application.DisplayAlerts = False

DisplayAlerts by itself does nothing.

You can also use this method with no message.

ActiveWorkbook.Close SaveChanges:=True


Gord Dibben MS Excel MVP
 
The first time you save the workbook, it needs a path and filename. Use
SaveAs instead of Save, and provide a full name. This should avoid the Save
As dialog popping up.

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top