automationamateur
Board Regular
- Joined
- Jan 3, 2011
- Messages
- 166
I was recently upgraded from Excel 2013 (32 Bit) to Excel 2016 (64 Bit) on windows 7 enterprise OS. Macros I have been using for years have all the sudden stopped working and erroring out on the oddest code. Any help is greatly appreciated, I'm not sure what I am missing. Thanks!
This existing code that is extremely simple and has worked for years now creates error, "Run-time error '-2147417848 (80010108)':Method 'Delete' of object' _Worksheet' failed"
When I run macro recorder to accomplish the same task Excel 2016 now creates this:
This existing code that is extremely simple and has worked for years now creates error, "Run-time error '-2147417848 (80010108)':Method 'Delete' of object' _Worksheet' failed"
Code:
Sheets("Sample Sheet").Delete
When I run macro recorder to accomplish the same task Excel 2016 now creates this:
Code:
Sheets("Sample Sheet").Select
ActiveWindow.SelectedSheets.Delete