tbakbradley
Board Regular
- Joined
- Sep 24, 2010
- Messages
- 142
Hello all,
I built a tool for my organization several years ago. There have been many versions within that time. Our company has received several Updates to our Computers, where we have had to reboot multiple times a day. One of our Sales Engineers let me know they could not Build their Request from the Tool I built. I checked, and sure enough, I'm getting a Run-Time Error 2147417848 (80010108)- Method 'Delete' of object 'Range' failed. This file is saved on two different servers as well as my Hard Drive. All produce the same Run Time Error. My entire team has tried from one of the Servers to receive the same Run Time error as me and the Sales Engineers.
The Code below has not changed for about 5 years or so. I've had SEVERAL Versions of the overall tool in the last five years. What is odd, is that I've went back and ran ever Version back to 2015, and ALL of them produce the same Run Time Error as of today. I'm wondering if one of the updates the Company has pushed to all of our Laptops has created some Registry issue with Excel and VBA with some lines of Code?
When the user clicks the Macro Button, they receive an Input Box asking the User how many Locations they require. Once they enter the number, it is stored into the Variable "locations". There are 500 Locations prebuilt on both the "TLS Inquiry" and the "Locations" Worksheets. The header is on the 3rd Row and the Data starts on the 4th, so you understand the code. The Macro continues to work fine for the "TLS Inquiry" Worksheet, but fails at the "Locations" Worksheet portion of the code. It actually deletes all the appropriate rows, but then gives the Run Time error I provided AND the entire spreadsheet locks up and any Totals now show "#REF".
Any idea what could be going on? I've been banging my head on my desk all day as now all Spreadsheets back to 2015 (didn't check further back) no longer work and we've not had a problem until Friday. Also, although I do all my work in Excel 2010, I have to save the Excel File as 2003 because our massive System Screen Scrapes data from the Spreadsheet and the system doesn't support .xlsm. Don't ask!!
The
works for the "TLS Inquiry" Worksheet but the Run Time Error happens when it's run again on the "Locations" Worksheet.
I built a tool for my organization several years ago. There have been many versions within that time. Our company has received several Updates to our Computers, where we have had to reboot multiple times a day. One of our Sales Engineers let me know they could not Build their Request from the Tool I built. I checked, and sure enough, I'm getting a Run-Time Error 2147417848 (80010108)- Method 'Delete' of object 'Range' failed. This file is saved on two different servers as well as my Hard Drive. All produce the same Run Time Error. My entire team has tried from one of the Servers to receive the same Run Time error as me and the Sales Engineers.
The Code below has not changed for about 5 years or so. I've had SEVERAL Versions of the overall tool in the last five years. What is odd, is that I've went back and ran ever Version back to 2015, and ALL of them produce the same Run Time Error as of today. I'm wondering if one of the updates the Company has pushed to all of our Laptops has created some Registry issue with Excel and VBA with some lines of Code?
When the user clicks the Macro Button, they receive an Input Box asking the User how many Locations they require. Once they enter the number, it is stored into the Variable "locations". There are 500 Locations prebuilt on both the "TLS Inquiry" and the "Locations" Worksheets. The header is on the 3rd Row and the Data starts on the 4th, so you understand the code. The Macro continues to work fine for the "TLS Inquiry" Worksheet, but fails at the "Locations" Worksheet portion of the code. It actually deletes all the appropriate rows, but then gives the Run Time error I provided AND the entire spreadsheet locks up and any Totals now show "#REF".
Any idea what could be going on? I've been banging my head on my desk all day as now all Spreadsheets back to 2015 (didn't check further back) no longer work and we've not had a problem until Friday. Also, although I do all my work in Excel 2010, I have to save the Excel File as 2003 because our massive System Screen Scrapes data from the Spreadsheet and the system doesn't support .xlsm. Don't ask!!
The
Code:
Rows(4 + (locations)).Resize(500 - locations).Delete
Code:
Sheets("TLS Inquiry").Select
If locations < 500 Then
Rows(4 + (locations)).Resize(500 - locations).Delete
Sheets("Locations").Visible = True
Sheets("Locations").Select
[COLOR=#ff0000] Rows(4 + (locations)).Resize(500 - locations).Delete[/COLOR]
Range("B4").Select
Sheets("Locations").Visible = xlVeryHidden
Sheets("TLS Inquiry").Select
End If