Re: AutoNew and Private
- From: "Jezebel" <warcrimes@xxxxxxxxxxxxxx>
- Date: Fri, 27 Oct 2006 21:16:55 +1000
Two entirely separate issues.
"Private" means that the declaration is visible only within the module.
Your 'select case' construction is a simple syntax error: you're missing the
'end select'; and in this case (as in most select case constructions) you
also need to deal with the possibility that the case will be other than
green.
"Dan Kelly" <DanKelly@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:394A3C83-69D3-4F55-A05C-6CFAF30DEB6D@xxxxxxxxxxxxxxxx
I am trying to get my head around Private declarations and AutoNew/AutoOpen
options.
I have the following code that works:
Option Explicit
Dim cb As CommandBarComboBox
Sub AutoNew()
SetComboBox
End Sub
Private Sub SetComboBox
Set cb = CommandBars("Test").Controls.Add(msoControlComboBox)
with cb
.OnAction = "SetColour"
.AddItem "Green"
' Other setup stuff that works....
End With
End Sub
Private Sub SetColour
Select Case cb.Text
Case "Green"
'Run another Macro that doesn't matter here
EndSub
If however I declare AutoNew as Private so that it is hidden from the
Macro
list then the above breaks at the Select Case Statement.
Where am I going wrong?
.
- Prev by Date: Re: select "hard page" code?
- Next by Date: Re: Help Needed Speeding Up Code
- Previous by thread: Re: How to change the size of a text box on a page
- Next by thread: Re: AutoNew and Private
- Index(es):
Relevant Pages
|