+ Reply to Thread
Results 1 to 4 of 4

VBA opens word then keeps trying to open the same document

  1. #1
    Registered User
    Join Date
    10-07-2012
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    2

    VBA opens word then keeps trying to open the same document

    Hi
    I have a macro that will open a word document and copy information from excel to a table in the document. I can create a new word document that is blank, and transfer data but whenever I try to open an existing document, excel keeps opening the document. This causes the document I want to open, then the same document with a read only warning to open. if I cancel this then my code fails with runtime 4198 and highlights the open document line.

    Please Login or Register  to view this content.
    If I try opening the document and include a ignore read only command then it will continue opening versions of the same word document until I close it on task manager.
    If I remove the document and only try to create a word application it does the same thing.

    I have tried various coding methods to open word, and documents, and this happens every time.

    I'm on a networked computer in my workplace but both local and network versions cause this issue. Is there something corrupted, or another issue in excel or word?
    Or am I just missing something really obvious.

    Any Help would be much appreciated
    (I'm teaching myself VBA, slowly, through trial and error. I may not understand you if you get too technical )
    Thank You

    LS

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: VBA opens word then keeps trying to open the same document

    There is nothing in the code snippet you posted that would cause the described behaviour. Of course, if that code's inside a loop (or is being repeatedly called by code in a loop), that would explain it. I note also that your document is in the docm format, which implies the document contains macros of its own. Those, too, might have some bearing on the matter.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    10-07-2012
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: VBA opens word then keeps trying to open the same document

    I've tried writing the code in a new excel document on its own with no other code, ams replaced the document with a regular .docs
    IT still tries to open it several times. Thanks for your suggestions though.

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: VBA opens word then keeps trying to open the same document

    In that case, I'd be looking into the macro(s) in the document you're opening.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Already Open Word Document
    By yawnzzzz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-16-2014, 11:22 PM
  2. open excel source document in background when i open word document
    By hootiebsc in forum Word Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2013, 07:50 PM
  3. Word browsing folder and open txt files in word document.
    By naseerrahaman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2013, 03:38 AM
  4. Replies: 0
    Last Post: 06-07-2012, 02:21 PM
  5. Replies: 3
    Last Post: 03-30-2006, 12:10 PM
  6. [SOLVED] open a new word document
    By Ciara in forum Excel General
    Replies: 2
    Last Post: 05-18-2005, 07:06 AM

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