BEFORE SAVE

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

Guest

I would like to private sub like workbook_beforesave to save workbook with new name.
I tried before save writing macro with saveas command in it but this caused excel to perform an illegal operation I think this is due to me asking for circular function i.e before save and saveas in same procedure.
So what I am asking is before operator saves workbook I would like the name of workbook to change either with msgbox prompt or as cell.value is this possible?
hope this is clear
thanks
Tina
 
Hi
in the BeforeSave event try something like

'....
application.enableevents=false
me.saveas "your_new_name.xls"
application.enableevents=true
'...
-----Original Message-----
I would like to private sub like workbook_beforesave to save workbook with new name.
I tried before save writing macro with saveas command in
it but this caused excel to perform an illegal operation I
think this is due to me asking for circular function i.e
before save and saveas in same procedure.
So what I am asking is before operator saves workbook I
would like the name of workbook to change either with
msgbox prompt or as cell.value is this possible?
 
You may also want the CANCEL flag be set to TRUE so that Excel is not
executing a save operation (Cancel = True).
 

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