xla and ActiveWorkbook.Save

S

Steven

I have and xla file and one of the macro's code is ActiveWorkbook.Save.

I have run into an issue with a file that has some Before_Save code. If I
use the xla macro with the ActiveWorkbook.Save it will hang up in this file,
apparently when it hits the Before_Save on the file.

How do you handle this issue?

Thank you,

Steven
 
R

Ron de Bruin

Hi Steven

You can turn off Events maybe


Application.EnableEvents = False

Code

Application.EnableEvents = True
 
S

Steven

Ron,

Thank you for the response. The only thing is that some files have clean up
code before saving. If I use the regular save button it works fine but if I
use the xla then it hangs up. I put a Save on the Right Mouse Click that
runs the xla macro for ActiveWorkbook.Save. I really cant bypass what might
be in some files though.

Thank you,

Steven
 
S

Steven

Ron,

After reconsidering, the only thing I should have in the before save was to
test if the user had clicked Save_As , which is not allowed. All the other
code can be moved to the Auto_Open sub. That definitely takes care of that.

Steven
 

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