none
VBA check for an open project RRS feed

  • Question

  • How can i check for an open project in vba?  I tried this, but i error 424, 'Object required'

        If Application.ActiveProject Is Nothing Then
            MsgBox ("No active project!")
            Exit Sub
        End If

    Wednesday, April 9, 2014 6:42 PM

Answers

  • Sugargenius --

    How about trying the following code which works for me:

    If Application.Projects.Count = 0 Then

    Hope this helps.


    Dale A. Howard [MVP]

    • Marked as answer by Sugargenius Wednesday, April 9, 2014 7:01 PM
    Wednesday, April 9, 2014 6:44 PM
    Moderator

All replies

  • Sugargenius --

    How about trying the following code which works for me:

    If Application.Projects.Count = 0 Then

    Hope this helps.


    Dale A. Howard [MVP]

    • Marked as answer by Sugargenius Wednesday, April 9, 2014 7:01 PM
    Wednesday, April 9, 2014 6:44 PM
    Moderator
  • Perfect! Thanks, Dale
    Wednesday, April 9, 2014 6:55 PM