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.