![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Bill: You need to activate objSht2 before selecting a range on the sheet. If you add the following line, the error does not occur: objsht2.Activate 'Add this line before the following HERE'S WHERE THE ERROR OCCURS... .Range("A2:B2").Select Range(Selection, Selection.End(xlDown)).Select Selection.Delete Shift:=xlUp The strangest thing about it is that the 1st error handler works and shoots the code down to "XLSheet2:" But at the point where I get the msg, the error handler is ignored and I get a run-time error 1004. As you can see, I've tried to close the workbook and reset the objects in order to open it for the user, as opposed to having him hunt for it in a directory on the server. Obviously, if he's gone to all the trouble to update the data in the chart, he'd probably like to take a look at it. When the code 1st runs, I check in Task Manager and Excel is not running until my code sets the objXL. Pls advise. |
#4
| |||
| |||
|
|
Bill: You need to activate objSht2 before selecting a range on the sheet. If you add the following line, the error does not occur: objsht2.Activate 'Add this line before the following HERE'S WHERE THE ERROR OCCURS... .Range("A2:B2").Select Range(Selection, Selection.End(xlDown)).Select Selection.Delete Shift:=xlUp |
#5
| |||
| |||
|
|
Bill: You need to activate objSht2 before selecting a range on the sheet. If you add the following line, the error does not occur: objsht2.Activate 'Add this line before the following HERE'S WHERE THE ERROR OCCURS... .Range("A2:B2").Select Range(Selection, Selection.End(xlDown)).Select Selection.Delete Shift:=xlUp The strangest thing about it is that the 1st error handler works and shoots the code down to "XLSheet2:" But at the point where I get the msg, the error handler is ignored and I get a run-time error 1004. As you can see, I've tried to close the workbook and reset the objects in order to open it for the user, as opposed to having him hunt for it in a directory on the server. Obviously, if he's gone to all the trouble to update the data in the chart, he'd probably like to take a look at it. When the code 1st runs, I check in Task Manager and Excel is not running until my code sets the objXL. Pls advise. |
![]() |
| Thread Tools | |
| Display Modes | |
| |