+ Reply to Thread
Results 1 to 2 of 2

VBA SET Command to Open Workbook is Generating Errors

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2003
    Posts
    4

    VBA SET Command to Open Workbook is Generating Errors

    Hi all, hoping someone can help with this:
    Using the Set command (xl2003) to open a Shared Workbook, (or re-open if already in use, as it usually is, being a Shared file and all), to grab some data for my project. The code shown below works fine, [both WITH and WITHOUT the shared file already being opened in my session, ...however, when other users run the same code, it errors out, complaining that the file is already open, and that you can not have (2) instances of the same file open at the same name.
    With DisplayAlerts being False, the warning about re-opening a file already open should be overridden, and the file should close, and re-open without issue, as it does on my machine. (Users in question have same admin privileges to the directory as I do).
    Anyway, I am stumped, here's the section of code giving me grief. Note: it is the "Set dbWB3 = Workbooks.Open(dbFPath2 & "\" & dbFName2)" line that it errors on. If anything jumps out, please advise!
    Please Login or Register  to view this content.
    Last edited by stevelogistics; 03-06-2013 at 09:19 AM. Reason: Found Solution

  2. #2
    Registered User
    Join Date
    10-24-2012
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA SET Command to Open Workbook is Generating Errors

    Found solution by adding the following code directly above the "Set dbWB3 = Workbooks.Open(dbFPath2 & "\" & dbFName2)" trouble line. (This served to activate the file if already open and close it, ...or error if not open and call the set=open code as prescribed.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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