Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide Sheets during save (97/2000)

    I want saved versions of my sheet to have some sheets hidden (so other users, even with VBA disabled) will not see them upon load (and I need to force people to have macro's enabled as well; so things refuse to work with macros disabled).

    Of course when a user merely saves a sheet along the way (and not closes it), what I would need is:
    1) hide certain sheets
    2) save the WB
    3) unhide sheets again

    By placing code in a BeforeSave event I seem to be able to do points 1) and 2). How do I run code AFTER the save (point 3)?

    I can only think of disabling normal save and adding my own util to save... are there other/simpler ways???

    Thanks,

    Erik Jan

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide Sheets during save (97/2000)

    HI ErikJan,

    Add this at the end of the BeforeSave routine:

    Application.Ontime Now, "NameOfTheUnhidingSub"

    It ensures that *after* the beforesave sub is terminated *and* the save is executed, the sub Called NameOfTheUnhidingSub is run. In other words: After all already pending event routines are done, then the Ontime event is fired.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide Sheets during save (97/2000)

    That works like a breeze, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •