Event after closing project - Error 424

  • Thread starter Sebastian Cordoba
  • Start date

S

Sebastian Cordoba

Hi guys.

I created the following code in a class module of tte Global.MPT file:

Public Sub App_ProjectAfterSave()
<specific code>
End Sub

Everything works fine, but when I close the Project window I get the Error
424. Whay can I do to avoid this situation?

I read a reply for a previous post where the proposed code was this:

If not pj is nothing then
your code
End if

http://www.microsoft.com/office/com...&p=1&tid=358836e6-9c79-454c-b896-c138d2a4f737

But the event AfterSave doesn't have parameters as BeforeSave does (pj in
this case).

Thanks in advance.
 
Ad

Advertisements

S

Sebastian Cordoba

Hi Rod.

I've already tried your option and doesn't work. Forgot to tell you that I
get this error only if I close the Project window when it's empty (without
open projects) , I mean, this is what I do:
1- Close the project (File --> Close): The macro runs but there's no problem.
2- Close the window (File --> Exit): the macro runs and I get the error.

If a skip step 1 (close the window without closing the project) there's no
problem. But I want this code to work in every possible situation.

How do I verify that there are no open projects so I don't execute the code?

Thanks.
 
S

Sebastian Cordoba

Thank you so much Rod.

You don't know how much appreciate your help. I'm really glad I can count on
you.

Bye!
 
Ad

Advertisements

Ad

Advertisements


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