Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First, I think I'd move that cbar stuff out of the loop.
Option Explicit Sub CleanUpControls() Dim cbar As CommandBar Dim ctrl As CommandBarControl Set cbar = Nothing Set ctrl = Nothing Set cbar = Application.CommandBars("PastyFellow") Do Set ctrl = Nothing On Error Resume Next Set ctrl = cbar.FindControl(Tag:="Sifar") On Error GoTo 0 If ctrl Is Nothing Then Exit Do Else ctrl.Delete End If Loop cbar.Delete End Sub Second, on the troublesome pc, look under Tools|References. If you see a reference marked MISSING, then maybe unchecking that reference would fix the problem. I've never seen this error with a constant, though--but it'll be easy to check. sifar wrote: Hi Dave, Its nothing to with your code. getting the same message at a Cybercafe PC. works fine on my Home PC. Made some changes to your code..... Sub CleanUpControls() Dim cbar As CommandBar Dim ctrl As CommandBarControl Do Set cbar = Nothing Set ctrl = Nothing On Error Resume Next Set cbar = Application.CommandBars("PastyFellow") Set ctrl = cbar.FindControl(Tag:="Sifar") On Error GoTo 0 If ctrl Is Nothing Then Exit Do Else ctrl.Delete cbar.Delete End If Loop End Sub This worked fine for me by deleting the CustomCommandBar along with the Control. Please advice. -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to exchange Custom Commandbar buttons between PC's? | Excel Discussion (Misc queries) | |||
Custom Commandbar | Excel Programming | |||
static commandbar Button | Excel Programming | |||
Creating a CommandBar - what's wrong? | Excel Programming | |||
Value of ComboBox on Custom CommandBar | Excel Programming |