Tried everything???
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Tried everything???

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Jefferson City, Missouri
    Posts
    382
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have a worksheet that needs a password before it can be viewed, my problem is: if while I'm viewing the worksheet I save the workbook and close the file with that worksheet still open, the next time I open the file it opens on that sheet. I don't want that. I've put Sheets("week 1").activate in the before_save, before_close,open,deactivate,window_activate,and I'm sure some others (these have been in the workbook events). The before_save worked as I wanted but if the user wants to just save the work on that page and continue working on that page they will have to go back, re-enter the password before continuing, the open event didn't work because I have a splash screen that loads also and that slowed the week 1 sheet from activating until after the splash screen was done(10 seconds, but can still read what I don't want them to), in the open event I have the code:

    Load UserForm1
    Sheets("week 1").Activate
    UserForm1.Show

    can I speed that code up? All I want is if the user does end up saving and closing the workbook while still on the hidden worksheet, the next time the workbook is opened it will open on sheets("Week 1"). Any ideas?
    I appreciate the help from everyone at Mr. Excel.

    viper

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    have you tried;

    Sheets("week 1").Activate
    Load UserForm1
    UserForm1.Show

    In the workbook open event





    Ivan

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Jefferson City, Missouri
    Posts
    382
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Ivan,
    Yes I've tried it and just tried it again to see why I changed it. It's not as instant as I'd hoped. For a split second you can see the hidden sheet before it activates sheet 1. I guess I'm looking for probably the impossible and that I am hoping the users will not save and close on that worksheet. But again thanks, doing it the way you mentioned is faster than the way I had it so I'll keep it that way.

    viper

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Northern Ireland
    Posts
    113
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Have you tried putting this in at the start of the macro so that you can't see what's happening

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com