Tried everything???

viper

Active Member
Joined
Feb 15, 2002
Messages
382
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?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
have you tried;

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

In the workbook open event





Ivan
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,539
Messages
6,120,100
Members
448,944
Latest member
SarahSomethingExcel100

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top