This was working last week, and now fails.
Office 365 Click to Run
MSO (16.0.12325.20280) 64 Bit on Windows 10 (Latest Version Update)
All file names and locations are valid
All variables are defined
The code is running from inside MS Access and opens an Excel Workbook
Below is the part that fails in italic
The variables holding file name and path are ok
On Error Goto UpdateExcelError
Set oXL = New Excel.Application
Set oxlB = oXL.Workbooks.Open(strTFolder & strTFile)
Set oxlS = oxlB.Worksheets(“Title”)
With oxlS
.Range(“infClientID”).ClearContents
.Range(“infClient”).ClearContents
‘etc
End With
The worksheet exists, and the Range exists.
So, now the weird bit.
This is run off a command button, and fails on the italic line with an application-defined object error.
BUT…..
If you put a break point on the line
Set oxlS = oxlB.Worksheets(“Title”) in debug mode.
Then press continue execution everything works fine.
With no break point it always errors on the line
.Range(“infClientID”).ClearContents
with
Error
50290
Application-defined or object-defined error
It’s either something I have stupidly missed, or a bug.
It has been driving me nuts all day.
Anyone see what is going on?????