Hello, all of the sudden, once I updated to Windows 11 on both my 32-bit and 64-bit Office laptops, when I try to compile my programs, every instance of this command fails:
The error message when trying to compile flags the second instance of ".UsedRange" in the above command and is:lastRow = XLSheet.UsedRange.Rows(XLSheet.UsedRange.Rows.count).Row
Compile error:
Method or data member not found
lastRow is dimensioned as Long
The Excel objects are dimensioned as follows:
In all my applications that use the errored command, this command fails at the same point in each command.Dim xlApp As New Excel.Application Dim xlBook As Excel.Workbook Dim XLSheet As Excel.Worksheet
I have searched the Internet and have not found this issue listed. I realize that .UsedRange is fickle, but it always compiled without a problem. Windows 11 has broken it somehow such that it seems to have been deprecated. I have the proper reference to the Excel Type library in the Word application. Everything worked properly in Windows 10.
Any ideas why?


Reply With Quote
