Thread: User Form
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_2_] Rob van Gelder[_2_] is offline
external usenet poster
 
Posts: 11
Default User Form

Try this:

Sub AddToolbar()
Const cFormName = "MyForm"
Dim ctlTemp As CommandBarControl

On Error Resume Next
With CommandBars.ActiveMenuBar
Set ctlTemp = .Controls(cFormName)
If Err < 0 Then
Err.Clear
With .Controls.Add(msoControlButton, , ,
..Controls("&Help").Index, True)
.Style = msoButtonCaption
.Caption = cFormName
.OnAction = "RunMyForm"
End With
End If
End With
End Sub

Sub RunMyForm()
MsgBox "ToDo: Running Code Here"
End Sub



"Craig Somberg" wrote in message
...
WIN2K Excel 2000
===========================

I have a VB form I created that loads and functions perfectly on the
opening of the workbook.

What I need know is a way for the user to invoke the form at will from
the menu or toolbar. How ???

Thanks !!!

Craig