+ Reply to Thread
Results 1 to 6 of 6

Run Time Error Protecting Sheet and Code Refreshing Sheet Delay

  1. #1
    Banned User!
    Join Date
    06-18-2021
    Location
    Peru
    MS-Off Ver
    2010, Microsoft 365
    Posts
    431

    Run Time Error Protecting Sheet and Code Refreshing Sheet Delay

    Hello,

    There is workbook protection by selecting the green or red shapes in upper left of sheets.

    On the Monthly Report sheet there is code to update budget amounts by month, category, subcategory and amount. When the workbook is protected and running the update code it has run time error pointing out that the cell or chart is protected. I cannot find what cell it is referring to that is stopping the code from running. Can someone please find that so the code can run to update the amounts when the workbook is protected?

    Also when that is solved can the code run without the delay of the sheet (Monthly Report) refreshing?

    Thank you

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Run Time Error Protecting Sheet and Code Refreshing Sheet Delay

    When you get the error and the Debug option comes up, which line of code is highlighted?

    I've run the code with the sheets protected and unprotected and I get no error messages.

    BSB

  3. #3
    Banned User!
    Join Date
    06-18-2021
    Location
    Peru
    MS-Off Ver
    2010, Microsoft 365
    Posts
    431

    Re: Run Time Error Protecting Sheet and Code Refreshing Sheet Delay

    Oh it happens when I take away the Call UnProtect_Budget and Call Protect_Budget in Module 1.

    Then run Update:

    destination.Resize(UBound(inarr, 1), UBound(inarr, 2)).Value = inarr
    Last edited by BillySpivy; 07-04-2021 at 04:29 AM.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Run Time Error Protecting Sheet and Code Refreshing Sheet Delay

    Try adding the below to the ThisWorkbook module:
    Please Login or Register  to view this content.
    When the workbook is next opened it will protect the sheets in such a way that they're protected from users making changes but code will be able to manipulate the sheets.

    Does that help?

    BSB
    Last edited by BadlySpelledBuoy; 07-05-2021 at 03:59 PM.

  5. #5
    Banned User!
    Join Date
    06-18-2021
    Location
    Peru
    MS-Off Ver
    2010, Microsoft 365
    Posts
    431

    Re: Run Time Error Protecting Sheet and Code Refreshing Sheet Delay

    Yes thank you that does the trick.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Run Time Error Protecting Sheet and Code Refreshing Sheet Delay

    Glad I could help

    BSB

+ 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. Replies: 3
    Last Post: 10-27-2018, 01:06 AM
  2. [SOLVED] Getting Run-time Error with Code to save Sheet as PDF
    By SLIDE1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-11-2018, 10:20 AM
  3. [SOLVED] Protecting a sheet name with the sheet is generated by code
    By dougman824 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-02-2018, 01:45 PM
  4. [SOLVED] Run-time error '1004' - code failing when on a different sheet
    By bishoposiris in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-10-2016, 12:48 PM
  5. Run-time error 1004 when protecting sheet
    By BVT3030 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2013, 10:42 PM
  6. [SOLVED] Error macro - Protecting Sheet
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2013, 08:11 PM
  7. Long Time Delay To Paste From UserForm To Sheet
    By Minitman in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-05-2005, 08:35 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