+ Reply to Thread
Results 1 to 6 of 6

Shared Workbook (Workbook Open Code)

  1. #1
    Registered User
    Join Date
    08-07-2006
    Posts
    31

    Shared Workbook (Workbook Open Code)

    Greetings

    I have created a shared workbook and basically want the Main Menu worksheet to appear when the workbook is opened by any user.

    I put the necessary code into the Workbook Open procedure but it doesn't run.

    Is this because the Workbook Open procedure is bypassed if someone else already has the workbook open?

    Any help on this would be appreciated.

    Cheers.

    Chard

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Chard
    Greetings

    I have created a shared workbook and basically want the Main Menu worksheet to appear when the workbook is opened by any user.

    I put the necessary code into the Workbook Open procedure but it doesn't run.

    Is this because the Workbook Open procedure is bypassed if someone else already has the workbook open?

    Any help on this would be appreciated.

    Cheers.

    Chard
    Hi,

    what code did you put into the Workbook_Open, and are the users set with Macro security = High (disable macros)?

    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    08-07-2006
    Posts
    31
    Hi

    The code is basically Sheets("Menu").Select which works when the workbook isn't shared.

    All users click on Enable Macros when they open the workbook and the macros all work fine.

    However, if say 5 users all go to open the workbook they don't all get the Menu worksheet (as the code would suggest). Some get other worksheets within the workbook.

    I have included a Return to Main Menu command button on each worksheet but obviously this isn't ideal.

    Cheers

    Chard

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Chard
    Hi

    The code is basically Sheets("Menu").Select which works when the workbook isn't shared.

    All users click on Enable Macros when they open the workbook and the macros all work fine.

    However, if say 5 users all go to open the workbook they don't all get the Menu worksheet (as the code would suggest). Some get other worksheets within the workbook.

    I have included a Return to Main Menu command button on each worksheet but obviously this isn't ideal.

    Cheers

    Chard
    Hi,

    as you say, all users should trigger the event. The one thing that springs to mind is that EnableEvents has been set to False in the current session prior to opening the Shared workbook, in which case a (Shortcut key driven) macro that simply does Application.EnableEvents = True followed by a close and re-open would be the solution.

    Let mre know how you go.
    ---

  5. #5
    Registered User
    Join Date
    08-07-2006
    Posts
    31
    Hi Bryan

    Thanks for the response.

    If Event Handling was somehow set to false wouldn't all the macros fail(because they all work)? It's just the Workbook Open code.

    No matter what I put in there, say Message Boxes or whatever, it just doesn't execute in shared mode? I've gone into the shared workbook as the only user and if I save & exit on Sheet 2 (for example) then this is the sheet that the workbook opens with next time (totally ignores the Workbook Open code).

    I might have got round it by having the main menu selected via code when the Workbook closes, meaning that is the last sheet that was visible.

    I'll test it at work tomorrow, but it seems odd that code runs for Workbook Before Close, but doesn't for Workbook Open?

    Thanks for your time, mate.

    Chard

  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Chard
    Hi Bryan

    Thanks for the response.

    If Event Handling was somehow set to false wouldn't all the macros fail(because they all work)? It's just the Workbook Open code.

    No matter what I put in there, say Message Boxes or whatever, it just doesn't execute in shared mode? I've gone into the shared workbook as the only user and if I save & exit on Sheet 2 (for example) then this is the sheet that the workbook opens with next time (totally ignores the Workbook Open code).

    I might have got round it by having the main menu selected via code when the Workbook closes, meaning that is the last sheet that was visible.

    I'll test it at work tomorrow, but it seems odd that code runs for Workbook Before Close, but doesn't for Workbook Open?

    Thanks for your time, mate.

    Chard
    Chard,

    If Event handler is set to False then only the Event triggered items would not trigger. Macro or Button triggered items would still operate, and, in the unlikely setup that one of your buttons/macros then re-sets the Event handler to True then the Close would work.

    The only proof would be a workbook that simply re-set the handler to True immediately before opening the Shared book.
    I realise this is supposition and unlikely, but your case is unlikely, the Open should trigger for a Shared workbook as for an unshared one, hence the request for the Code used.

    Another test would be to share another book and test for similar results.

    hth
    ---

+ 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