Hi folks,
Hope all is well with you guys.
I'm trying to update a bunch of workbooks (reports) with new data feed, which is of production job and done by month.
The reports have more than one template (show tabs) and each has a few dropdowns, mostly combobox and buttons, nothing complicated. I set up a few Excel macros to automate the process. The problems are if I do not leave one of the combobox blank, I will always get a message saying that the spreadsheet where the combobox is residing cannot be found (Run-time error "9"). As a matter of fact, the tab is right there. So the process will certainly be interrupted. Otherwise, everything will go smoothly.
Is there any way of not to invoke events until the update process finished?
I tried something like 'Application.EnableEvents=False' and so on, but the problem cannot be solved.
Hope I made myself clear. This is the code for the combobox. Not sure if it helps a little.
Private Sub cmbBoxSelectGeoGraph_Change()
Sheets("ViewGraphs").Activate 'this is the sentence where I have 'Run-time error "9"' on; if I comment it out, the error will point to another tab that has nothing to do with the current one.
CurrSheetName = ActiveSheet.Name
Call cmdGraphRunQuery_Click
On Error Resume Next
ActiveWorkbook.Names("AcctNameRange").Delete
On Error GoTo 0
x = GeoTotAcct
Sheets("geoplanlist").Range("A2:A" & x).Name = "AcctNameRange"
Call CopyAcctName
Call cmdAcctGraphRunQuery_Click
With Sheets("ViewGraphs").OLEObjects("cmbKeyAcctGraph")
.ListFillRange = "AcctNameRange"
End With
Application.Range("A1").Select
End Sub
Thanks in advance.
Hope all is well with you guys.
I'm trying to update a bunch of workbooks (reports) with new data feed, which is of production job and done by month.
The reports have more than one template (show tabs) and each has a few dropdowns, mostly combobox and buttons, nothing complicated. I set up a few Excel macros to automate the process. The problems are if I do not leave one of the combobox blank, I will always get a message saying that the spreadsheet where the combobox is residing cannot be found (Run-time error "9"). As a matter of fact, the tab is right there. So the process will certainly be interrupted. Otherwise, everything will go smoothly.
Is there any way of not to invoke events until the update process finished?
I tried something like 'Application.EnableEvents=False' and so on, but the problem cannot be solved.
Hope I made myself clear. This is the code for the combobox. Not sure if it helps a little.
Private Sub cmbBoxSelectGeoGraph_Change()
Sheets("ViewGraphs").Activate 'this is the sentence where I have 'Run-time error "9"' on; if I comment it out, the error will point to another tab that has nothing to do with the current one.
CurrSheetName = ActiveSheet.Name
Call cmdGraphRunQuery_Click
On Error Resume Next
ActiveWorkbook.Names("AcctNameRange").Delete
On Error GoTo 0
x = GeoTotAcct
Sheets("geoplanlist").Range("A2:A" & x).Name = "AcctNameRange"
Call CopyAcctName
Call cmdAcctGraphRunQuery_Click
With Sheets("ViewGraphs").OLEObjects("cmbKeyAcctGraph")
.ListFillRange = "AcctNameRange"
End With
Application.Range("A1").Select
End Sub
Thanks in advance.