Save As Event

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

Guest

My save as event:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.Run "MyFile.xls!MyMacro"
End Sub
No longer fires on save. The macro exists and will run from a hot key.
What could have changed that it will not run on save?
Thanks!
 
Sounds like it is not in the ThisWorkbook code module.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Anywhere in your world do you have code that disables events? if so then
possibly your code errored out and the events were nort re-enabled, or you
were debugging and exited exectuion prior to re-eneabling or there is an
issue where you just neglect to re-enable the events. In any case jsut run
this code to reset your events...

sub test
application.enableevents = true
end sub

Now your events should be firing again. As always when you play with these
settings make sure your errorhandling is bullet proof and that your progarm
flow always resets the changes you make.
 
That got it thanks!!!

Jim Thomlinson said:
Anywhere in your world do you have code that disables events? if so then
possibly your code errored out and the events were nort re-enabled, or you
were debugging and exited exectuion prior to re-eneabling or there is an
issue where you just neglect to re-enable the events. In any case jsut run
this code to reset your events...

sub test
application.enableevents = true
end sub

Now your events should be firing again. As always when you play with these
settings make sure your errorhandling is bullet proof and that your progarm
flow always resets the changes you make.
 

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