Unprotect method fails using automation in excel 2013

I open an Excel spreadsheet using automation from MS Access. In the recalculate event, which fires first, I have the following code:
    Dim xSH1 as worksheet, rR1 as Range
    Set xSH1 = Worksheets("Sheet1")
    Set rR1 = Application.Range("CoverComments")

This code works fine in Excel 2003. However, in 2013, the unmerge fails with an error 1004 (Object-defined error). I discovered that the failure was caused by the fact that the sheet was not unprotected.  I inserted an "On Error" to get around it and found that the second time through the recalculation routine, it worked fine. In between, the line of code that made the difference was


Does anyone know why one works and the other doesn't? I've got something like 50,000 excel documents with this code in it and would not like to have to make the change in all of them. Thanks in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saurabh Singh TeotiaCommented:
I don't see any problem in your code it should work...Can you ensure sheet1 is the right name of the sheet as sheet1 is the vba name of the same which is their in the vb module..

Also you are not specifying a password when you are un-protecting the same..I'm assuming your password is blank..

jhseymour113Author Commented:
With no code changes whatsoever, the problem seems to have resolved itself. No I don't believe in magic, but I have no explanation. The system is working without a hitch.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.