Run time error 40036 RRS feed

  • Question

  • I am getting this Run time error 40036 when trying to unlock my worksheet. Works fine on another computer with same excel 365 version. Using latest 1807 version. Only happen through vba, if i manually unlock it with password, it works fine.

    Here is my code to unlock:

    Sheets("mysheet").Unprotect "mypassword"

    I've tried different other way to unlock and it still throwing error.

    Thursday, July 26, 2018 3:00 PM

All replies

  • Hi,

    Based on your description, I know that you are getting the VBA runtime error issue. To better resolve the issue, I will move it to Excel for Developers forum.

    Thanks for your understandings!

    Best Regards, 

    Herb Gu

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact

    Microsoft Team

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams
    Friday, July 27, 2018 5:32 AM
  • hello Vkid12,

    What kind of project did you build? To unprotect a worksheet in document-level customization,you could try the code below:


    To unprotect a worksheet in a VSTO add-in,you could try the code below:

    CType(Application.ActiveSheet, Excel.Worksheet).Unprotect(yourpassword)

    Best Regards,


    Friday, July 27, 2018 7:04 AM
  • Hello Vkid12,

    Expect the error code, what's the error message? Does the issue occur on every workbook or only on specific workbook? What's the building number of your office?

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, July 30, 2018 9:30 AM