![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
have you tried;
Sheets("week 1").Activate Load UserForm1 UserForm1.Show In the workbook open event Ivan |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: Northern Ireland
Posts: 113
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|