Greetings,
I have the following code that is set for Workbook Open. However the opening process takes as long as 30 seconds to open. Is it my code not correct?
Please Login or Register to view this content.
Greetings,
I have the following code that is set for Workbook Open. However the opening process takes as long as 30 seconds to open. Is it my code not correct?
Please Login or Register to view this content.
Last edited by 6StringJazzer; 05-30-2018 at 12:48 PM.
How many worksheets are there?
ETA: I tried this on a file with five sheets and it took under 2 seconds.
start 5/30/2018 12:53:38 PM
screen off 5/30/2018 12:53:38 PM
Sheet1 5/30/2018 12:53:38 PM
Sheet2 5/30/2018 12:53:38 PM
Sheet3 5/30/2018 12:53:39 PM
Sheet4 5/30/2018 12:53:39 PM
Sheet5 5/30/2018 12:53:39 PM
min ribbon 5/30/2018 12:53:39 PM
1 5/30/2018 12:53:39 PM
screen on 5/30/2018 12:53:39 PM
Last edited by 6StringJazzer; 05-30-2018 at 12:54 PM.
The workbook has 44 worksheets. However, I only have 1 open when starting up.
What do you mean by "open"? Do you mean visible? Your code touches every worksheet, whether or not it's visible. That is probably what is taking the time.
Yes, when visible. The code is to allow for macros to be run on protected worksheets. Should I use code for each worksheet? If so, what would the code be?
Please Login or Register to view this content.
I found the following code and inserted it into the worksheet code. I also disabled the code for the workbook and all seems to be running much faster.
Please Login or Register to view this content.
How is the new worksheet code is being called? I suspect it is not, which is why it would run faster.
I would do this in your workbook module:
Please Login or Register to view this content.
Last edited by 6StringJazzer; 05-30-2018 at 04:21 PM. Reason: removed errant space from xlSheet Visible
StringJazzer,
That works perfect!
I changed the third line
Please Login or Register to view this content.
Oh, sorry, my bad typing.
No worries!
I have another issue. I want to protect the Workbook, but with all the worksheets hidden, when I engage a macro to make the worksheet visible, I get an error. Is there a way to use the same code for the workbook?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks