+ Reply to Thread
Results 1 to 10 of 10

Troubleshhot Protected view

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Foster City, CA
    MS-Off Ver
    Excel 2010
    Posts
    37

    Troubleshhot Protected view

    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?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Troubleshhot Protected view

    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]

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Troubleshhot Protected view

    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."

  4. #4
    Registered User
    Join Date
    01-02-2013
    Location
    Foster City, CA
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Troubleshhot Protected view

    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.

  5. #5
    Registered User
    Join Date
    01-02-2013
    Location
    Foster City, CA
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Troubleshhot Protected view

    XeRo

    Could it be that there is no workbook_event handler in my workbook? Sorry for the ignorance.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Troubleshhot Protected view

    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.

  7. #7
    Registered User
    Join Date
    01-02-2013
    Location
    Foster City, CA
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Troubleshhot Protected view

    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.

  8. #8
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Troubleshhot Protected view

    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.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Troubleshhot Protected view

    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

    Quote Originally Posted by Microsoft
    Why do I see this message?

    This message can appear for a malicious file, which was created by a hacker to infect your computer with a virus or steal important information. This message means that editing the file could be dangerous. Sometimes the message appears for files that are damaged, for example:
    • The disk where the file is stored could be worn out or broken.
    • The file was created or edited with a program that has a problem.
    • An unexpected error occurred while copying the file to your computer, which can be caused by a problem with your Internet connection.
    • There could be a problem with how Office looks for problems in files. We work to make it better, but it’s not perfect.
    That last one troubles me just a little bit.

  10. #10
    Registered User
    Join Date
    01-02-2013
    Location
    Foster City, CA
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Troubleshhot Protected view

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Create Excel 2010 with VBA - it saves as Protected View
    By RxMiller in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2011, 04:59 PM
  2. Prevent Protected View
    By businessnaples in forum Excel General
    Replies: 1
    Last Post: 03-23-2011, 02:11 PM
  3. View form on protected sheet
    By Sirishgreen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2008, 10:44 AM
  4. How to view a custom view when the worksheet is protected?
    By JulesJam in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-06-2006, 10:20 AM
  5. [SOLVED] Can VBA codes can be protected from view.
    By Prakash in forum Excel General
    Replies: 6
    Last Post: 12-28-2005, 05:25 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1