Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    VBA 5479 Error (Word 2007)

    Folks,

    I'm testing several Word apps that have worked flawlessly in the last few versions of Word. Office is patched to SP2.

    However, under Word 2007, I'm getting the following error:

    Run-time error 5479 - You cannot close Microsoft Office Word because a dialog box is open.

    The code which causes it is:

    WordBasic.DisableAutoMacros 1
    Documents.Open FileName:=strFile, ReadOnly:=True <== Errors here
    frmProcessing.Repaint
    WordBasic.DisableAutoMacros 0

    Remming out the WordBasic lines have no effect.

    What is strange is that if I break to the de######, I can step through and open the document with no errors.

    The file does exist and opens manually from the network when I step through the code.

    Any thoughts?

    Thanks, Mort

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA 5479 Error (Word 2007)

    Can you check whether there's actually a dialog open, by using Alt+Tab for example?

  3. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Re: VBA 5479 Error (Word 2007)

    Hans,

    There isn't.

    That being said, I've found what's causing it.

    There's a lot of Word 'busy work' displayed while the document is being prepared, with my form (that displays the progress) on top of it.

    I've been hiding Word, and just displaying the status progress, with no problems:

    Application.ScreenUpdating = False
    Application.Visible = False

    Remming these out and the error goes away.

    Guess I've found a bug.

    Mort

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA 5479 Error (Word 2007)

    Thanks for posting back with the solution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •