LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default ComboBox.Enable giving error on ActiveWorkbook.RefreshAll

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveWorkbook.RefreshAll teepee[_3_] Excel Discussion (Misc queries) 0 November 11th 08 02:11 PM
ActiveWorkbook.RefreshAll teepee[_3_] Excel Programming 0 November 11th 08 02:11 PM
ActiveWorkbook.RefreshAll Matt Cromer[_2_] Excel Programming 3 July 24th 06 08:45 PM
ActiveWorkbook.RefreshAll nc Excel Discussion (Misc queries) 0 March 21st 06 10:50 AM
ActiveWorkbook.RefreshAll toosie Excel Programming 1 February 16th 05 09:55 AM


All times are GMT +1. The time now is 03:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"