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

    Word VBA Error 5479 (English/Word/2007)

    Our organization is planning to roll out Windows XP along with Office 2007. We currently are on Windows 2000 and Office 2003.

    I have a Word VBA application that opens a number of network documents, fills in data, saves the forms, then concatenates and prints them to a network printer.

    It has functioned flawlessly from Office 2002 through Office 2003.

    In our test environment, the application fails half the time.

    When running, I get an error message box with the following info:

    Run-time error '5479'
    You cannot close Microsoft Office Word because a dialog box is open. Click 'OK', switch to Word, and then close the dialog box.

    The only thing open and displayed during code execution is a form that was used by the user to collect information for selecting the document set. There is no dialog box.

    Unfortunately, the message box only has an 'End', 'Break' and 'Help' button. No 'OK' button.

    If I click on 'Break' for VBA, the offending line is:

    Documents.Open Filename:=strFileName, ReadOnly:=True

    What is strange is that 1) the document (strFileName) will have just opened in Word and that 2) clicking the VBA 'Continue' button causes the code to continue executing with out any other intervention.

    Windows XP is at SP2 and SP1 has been installed in Office. I even removed our corporate Norton Antivirus on this machine. It's not any sort of rights issue.

    I do sometimes see a Word generated window displayed with a status bar showing the progress of the document opening. I haven't found a setting to disable this.

    Any clues, hints or fix recommendations?

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

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

    Re: Word VBA Error 5479 (English/Word/2007)

    Hi Hans,

    I've not gotten that error message when trying to open any document through Explorer.

    There's no items in Word's startup folder that have an autoexec macro in them.

    In fact, I just disabled all Word items (templates, dll's, smart tage) with no effect.

    Scratching my head, here.

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

    Re: Word VBA Error 5479 (English/Word/2007)

    Another common cause for this problem is described in You receive a "The command cannot be performed because a dialog box is opened" error message when you try to open a file in Word 2007 or in Word 2003 but you wrote that you had already tried turning off Norton AntiVirus; you might check that the Office plug-in has been disabled though.

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

    Re: Word VBA Error 5479 (English/Word/2007)

    Appreciate the reply, Hans. I'd already looked for that file and it's not on the local drive. It doesn't appear in task manager, either. Wish I had Bill Gate's phone number. Since he's retired, he should have some idle time for troubleshooting. He should be cheap, seeing's he doesn't need any more money. I really hate that there's no tool available that helps with this stuff.

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

    Re: Word VBA Error 5479 (English/Word/2007)

    Does your organization have a compelling reason to migrate to Office 2007? It might be better to stay with Office 2003 for some time.

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

    Re: Word VBA Error 5479 (English/Word/2007)

    Hans - We've got a corporate wide application (imaging related) that requires Office 2007, for some reason. End of story for us developers lower in the food chain.

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

    Re: Word VBA Error 5479 (English/Word/2007)

    <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15>

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Word VBA Error 5479 (English/Word/2007)

    <hr>You cannot close Microsoft Office Word because a dialog box is open. Click 'OK', switch to Word, and then close the dialog box.<hr>
    Are you closing a document before you open strFile? Are you quitting an instance of Word completely? Maybe the word "close" is spurious. Either way, perhaps you can build in a little delay to allow more time for Word to finish its cleanup or whatever it is busy doing. Also, make sure you turn off background saving and background printing to help reduce the potential for lagging processes running asynchronously.

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

    Re: Word VBA Error 5479 (English/Word/2007)

    Believe I'll give that a try on Monday. There is a lot of opening and saving/closing of douments going on.

  11. #11
    New Lounger
    Join Date
    Mar 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA Error 5479 (English/Word/2007)

    Did you Reference Microsoft Word 12 Object Library and every other version of Word you are using ?

  12. #12
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Word VBA Error 5479 (English/Word/2007)

    And maybe even:
    Application.DisplayAlerts = wdAlertsNone
    Cheers,

    Paul Edstein
    [MS MVP - Word]

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

    Re: Word VBA Error 5479 (English/Word/2007)

    A brief update:

    We are using the latest Office 12 objects. Between the delay routine and DisplayAlerts flag addition, everything is working fine now.

    Appreciate the help, folks.

Posting Permissions

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