+ Reply to Thread
Results 1 to 3 of 3

Checking if a certain document is already open

  1. #1
    Registered User
    Join Date
    01-07-2016
    Location
    DK
    MS-Off Ver
    2015
    Posts
    5

    Checking if a certain document is already open

    Hi,

    I had a lot of success asking you guys for help last time I had a problem, so I hope you can help me once again.

    I'm writing an excel script which opens a template document and does a bunch of editing to it. But before it does all this I want to make sure the document isn't already open. To accomplish this I tried the following piece of code:

    Please Login or Register  to view this content.
    The problem with this is that it will give me an "ActiveX component can't create object" error if no word documents are currently open. I bet you guys can help me out on this.

    Thank you very much in advance.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Checking if a certain document is already open

    Try something like this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    01-07-2016
    Location
    DK
    MS-Off Ver
    2015
    Posts
    5

    Re: Checking if a certain document is already open

    Thank you very much, works like a charm.

    Much more elegant than my solution. I was considering just opening a new empty word document, but that seemed kind of stupid

+ 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. Checking in a Document in SharePoint from Macros
    By tsaravana in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2015, 12:33 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. Replies: 0
    Last Post: 06-07-2012, 02:21 PM
  4. Checking to see if Outlook is open
    By djvice in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2008, 04:53 PM
  5. Checking for Open Workbook
    By DonovanKB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2008, 09:55 PM
  6. Checking for open file
    By jweasl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2006, 05:35 PM
  7. Replies: 1
    Last Post: 06-03-2005, 02:05 PM

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