Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have cascading Active ComboBoxes. In the code below I disable Cbo2 If
Cbo1.Value = "0" Else Enable. These CboBoxes are on a sheet, not a UserForm. In the code, when the Dropdown is opened it requeries Cbo2,3,4 to ListIndex = 0.I tried a Change sub with a Cbo.Enable = True/False to disable and enable the proceeding Active ComboBoxes. It works great for the Cascading Dropdowns. However Im getting a Run-time error 1004 on the Enable = True/False, from my CmdButton sub CmdRefreshAll_Click (see 2nd sub below). It has an ActiveWorkbook.RefreshAll. I even tried reversing the If in the Cbo. Private Sub Cbo1_Change() If Cbo1.Value = "0" Then Cbo2.ListIndex = 0 Cbo3.ListIndex = 0 Cbo4.ListIndex = 0 'Run-time error 1004 on ActiveWorkbook.RefreshAll (see CmdRefreshAll sub) Cbo2.Enabled = False 'Run-time error 1004 Cbo3.Enabled = False 'Run-time error 1004 Cbo4.Enabled = False 'Run-time error 1004 Else Cbo2.ListIndex = 0 'Run-time error 1004 on ActiveWorkbook.RefreshAll (see CmdRefreshAll sub) Cbo2.Enabled = True 'Run-time error 1004 End If End Sub Private Sub CmdRefreshAll_Click() 'Refresh data sheets from outside data sources & Pivotsheets Application.ScreenUpdating = False I was hoping this would resolve issues in change sub Application.EnableEvents = False ActiveWorkbook.RefreshAll 'Add RefreshAll date & time to Form page Sheets(1).Select Range("H1").Value = "Refresh All Date: " Range("H2").Value = Now Application.ScreenUpdating = True MsgBox "All Data Sheets & Pivot Tables in this Workbook are updated" End Sub -- Thanks, Kevin |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ActiveWorkbook.RefreshAll | Excel Discussion (Misc queries) | |||
ActiveWorkbook.RefreshAll | Excel Programming | |||
ActiveWorkbook.RefreshAll | Excel Programming | |||
ActiveWorkbook.RefreshAll | Excel Discussion (Misc queries) | |||
ActiveWorkbook.RefreshAll | Excel Programming |