I have a spreadsheet with several pivot tables in it. I have a combo box that, when changed, changes the PAGE setting of the pivot tables. What I learned through trial and error is that you have to select another cell (Range(XX).Select) before the pivot tables will update, so the first thing in my combobox code is:
This works fine and dandy, however, when I exit the worksheet, for some reason that combo box changes and I get an error because the spreadsheet has closed and Excel attempts to select that range. The error is "Run Time Error 1004, Select Method of Range class failed."
What can I do to skip over this error, or disable it? I can't take the range.select code out because otherwise the VBA errors out because the combo box is selected and the pivot tables can't update.
I tried using an "On Error goto ErrorHandler" and then under ErrorHandler: I put simply Resume Next, which resides just before End Sub. I can close the spreadsheet without error, but then Excel locks up, blank, and just sits there for a while, no doubt going through some stupid endless loop.
Help!! Onwards,
Q-
Code:
Range("A2").Select
This works fine and dandy, however, when I exit the worksheet, for some reason that combo box changes and I get an error because the spreadsheet has closed and Excel attempts to select that range. The error is "Run Time Error 1004, Select Method of Range class failed."
What can I do to skip over this error, or disable it? I can't take the range.select code out because otherwise the VBA errors out because the combo box is selected and the pivot tables can't update.
I tried using an "On Error goto ErrorHandler" and then under ErrorHandler: I put simply Resume Next, which resides just before End Sub. I can close the spreadsheet without error, but then Excel locks up, blank, and just sits there for a while, no doubt going through some stupid endless loop.
Help!! Onwards,
Q-