Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - trapping SaveAs

Status
Not open for further replies.

baronvont

Technical User
May 15, 2001
77
0
0
AU
Hi,

I need to trap the save or SaveAs controls on the menubar, so I can control where and when the user saves a document.

It's easy enough to see how the BeforeSave sub works, putting my own save commands in, but the problem is that when the code finishes, it still opens the standard save dialog box. Any ideas on how to stop it opening?

I tries sendkeys in the hope an escape would cancel it but no luck

Thanks
Georg
 
Hi Georg,

Just put
Code:
Cancel = True
somewhere in your routine to suppress the built-in save.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Georg,

Check out the Workbook_BeforeSave event. It will allow you to distinguish if user has chosen SaveAs.


Regards,
Mike
 
Sorry,

guess I should finish reading before beginning to type!

Mike
 
Thanks Tony the Cancel = True does the trick

Georg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top