+ Reply to Thread
Results 1 to 6 of 6

Copy to open Workbook

  1. #1
    Registered User
    Join Date
    10-31-2010
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    95

    Copy to open Workbook

    I am trying to create a workbook for our traffic dept. to track all new orders. This workbook needs to stay open all the time so the traffic guy can see when a new order comes in.

    I am fairly green to vba programming, so please be gentle...

    The code below is what I currently have that works fine if the "traffic.xlsm" sheet is closed, but if it is opened, I get "Traffic.xlsm is already open. Reopening will cause any changes you made to be discarded. Do you want to reopen Traffic.xlsm?"

    I thought that by sharing the Traffic.xlsm spreadsheet, that this wouldn't be an issue, but it obviously isn't working as intended.

    Can anyone tell me how we can keep Traffic.xlsm open all the time and still allow this code to execute from the main spreadsheet that populates Traffic.xlsm?

    I thought if I just removed the last line, "ActiveWindow.Close", that it would work, but I'm obviously missing something more.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    10-31-2010
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    95

    Re: Copy to open Workbook

    Just a thought: What if the vba checked to see if traffic was already opened and if so, closed it, then processed the code, and then reopened it on the "traffic" computer? Seems like a lot of work to me and my mind is mush right now... probably the 4 planet alignment and Friday the 13th...

  3. #3
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Copy to open Workbook

    Cabinetguy,

    When I refer to a workbook that is already open, I use
    Please Login or Register  to view this content.
    hope that helps a bit

  4. #4
    Registered User
    Join Date
    10-31-2010
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    95

    Re: Copy to open Workbook

    even if it's open on another machine?

  5. #5
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Copy to open Workbook

    cabinetguy,

    I'm guessing your using some sort of shared network drive to store the files. I know that with the way my company has things set up, I would not be able to close down a file on another person's computer, as handy as that would be.

    If this is being used on a shared network, would it be possible for the guy in the traffic dept to trigger the macro from the traffic.xlsx workbook?

  6. #6
    Registered User
    Join Date
    10-31-2010
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    95

    Re: Copy to open Workbook

    Actually, as long as I have the workbook open on my computer AND his, it works and updates every 5 minutes, as set up in the workbook sharing properties.

    My mind is fried right now, so I am not even going to propose on here how I will make sure that the file is opened here before it attempts to write, but I'm certain that come Monday, I'll be able to get it going.

    Thanks for the help. I'd close this thread as solved, but I can't seem to figure out how... I don't have the option
    Last edited by cabinetguy; 05-13-2011 at 03:35 PM.

+ 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