q; workbook save and close

J

JIM.H.

In excel macro;
1. How can I make this? save as overwrite, without save dialog box
ActiveWorkbook.SaveAs Filename:=myFile, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


2. How can I make this? close it without saving and asking confirmation?
myWorkbook.Close
 
D

Dave Peterson

Add a couple of lines:

application.displayalerts = false
'your code to save
application.displayalerts = true

and tell excel how to close your file:

myWorkbook.close savechanges:=true 'false????
 

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

Top