I have an excel workbook with about 10 worksheets, hundreds of formulas, and scores of macros. It now intermittently loads in Protected View. Is there a way to troubleshoot this to the source?
I have an excel workbook with about 10 worksheets, hundreds of formulas, and scores of macros. It now intermittently loads in Protected View. Is there a way to troubleshoot this to the source?
What do you mean by Protected View? Protection isn't a view; do you mean the whole workbook is protected, or some individual worksheets are protected?
Intermittently? That's what makes it hard.
I can't think of a way for this to happen intermittently that is not caused by code. When you open it, do not allow macros to run and see if it still happens. If it still happens with macros disabled, then it's not code and I can't help.
Do any of the macros Protect or Unprotect the workbook or sheets? If you bring up the VBA development window and search on Protect (make sure Current Project is checked). If it loads like that and code is responsible, the code may be in the ThisWorkbook module.
Jeff
| | |·| |·| |·| |·| | |:| | |·| |·|
Read the rules
Use code tags to [code]enclose your code![/code]
To answer directly, yes there is a way. I won't say there is an easy or quick way. It could involve quite a bit of work. However, if its 'loads in Protected View' as in when you first open the worksheet, I would have to guess the code is somewhere in the workbook_open event.
Open the VBE, go the the workbook module. Look for the workbook_open event handler and step through that code first.
Not a sure-fire way but its a good starting point.
Thanks,
Solus
Please remember the following:
1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.Highlight the code in your post and press the # button in the toolbar.2. Show appreciation to those who have helped you by clicking below their posts.
3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.
"Slow is smooth, smooth is fast."
Protected view is when excel thinks there's an issue with the file. Mostly, when I launch excel first, then open the file, it doesn't open in protected view. However, when I launch excel by clicking on the file, then it does open in Protected view. I can't say this is consistent however. I think that it depends upon if it loaded in protected view earlier or not.
I do have several macros that Unprotect, perform some tasks, then Protect a sheet. This is code I wrote to reset a sheet to a starting state. I need to unprotect or the code won't run succcessfully.
XeRo
Could it be that there is no workbook_event handler in my workbook? Sorry for the ignorance.
Yes it could be. If no code is run automatically when you open the workbook.
Where are you opening the workbook from? Protected view usually kicks in if its from a network source outside your domain.
The file is on my C drive. It wouldn't be a big issue, nut the file is to be distributed and used by 40 or so sales reps for product pricing calculations. I just went in and deleted a bunch of modules in the VBE that were blank and some macros that are no longer used to try to clean it up to see if that helps.
Troubleshooting remotely is pretty difficult. If it becomes pertinent perhaps you can redact any sensitive information from your workbook at attach it so we can go over what you have.
My apologies, I misunderstood what was going on. Normally if a file opens in Protected View, you can enable editing and save it, and it will no longer open in Protected View. Are you enabling, saving, but it still opens in Protected View on a subsequent access? I don't think there is anything that macro code can do to induce Protected View, because I believe that when an Excel file with macros opens in Protected View, the macros aren't yet enabled.
Although the chance are remote there could be other underlying problems that cause this that are out of your control. Some info found here http://office.microsoft.com/en-us/ex...010355931.aspx such as
That last one troubles me just a little bit.Originally Posted by Microsoft
OK, thanks. I'll go ahead and mark this solved. I think it is the fourth bullet unless my Excel program has a problem as noted in the second bullet.
I appreciate you spending time on this.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks