+ Reply to Thread
Results 1 to 4 of 4

Opening word docs bug

  1. #1
    Registered User
    Join Date
    02-14-2010
    Location
    Australia, Australia
    MS-Off Ver
    Excel 2007
    Posts
    12

    Opening word docs bug

    I'm having a problem opening word documents from within an Excel marco. Here is my code

    Please Login or Register  to view this content.
    Up to "set wdapp" works fine, and an instance of microsoft word opens. However, I can never get the word document open. I just stays on that line of code for more than a minute, then I have to kill WinWord in the task manager to get back control of excel.

    Has anyone had this prob before?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,420

    Re: Opening word docs bug

    Try:

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    02-14-2010
    Location
    Australia, Australia
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Opening word docs bug

    Thanks for the reply.

    I think the initial problem had something to do with trying to create a new instance of word when one was already running. Additionally, since I was terminating the word process using the task manager all the time the word document became corrupted and this caused VBA to get stuck on the wdapp.documents.open line.

    Thanks for the advice all the same.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,420

    Re: Opening word docs bug

    The problems that I addressed were that you'd used a different variable, than the one you'd defined, for the document and I made the word application visible so that I could see what was happening. This makes it easier to debug and to close the word application if the code doesn't do what you expect. You could have several instances of word without knowing .

    Anyway, if your problem has been answered, please mark the thread as solved. See my signature for details or the FAQ.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1