Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Create a button on toolbar or on the sheet itself, and add code
"UserForm.Show" substituting the name of your form for UserForm "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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have these routines setup and I keep getting the error:
The macro 'NameOfWorkBook.xls!ShowExtractorForm' cannot be found. Any clues ? This code is in the WorkBook, not a module or worksheet. Thanks. Craig Private Sub Add_E_ToolBar() Dim cb As CommandBar Dim mnu As CommandBarControl Dim iIndex As Integer Set cb = Application.CommandBars("Worksheet Menu Bar") ' does the menu item exist already? On Error Resume Next iIndex = cb.Controls("Craig").Index If Err < 0 Then Err.Clear Else Set cb = Nothing Exit Sub End If ' if we are here we need to create everything iIndex = cb.Controls("Help").Index Set mnu = cb.Controls.Add(Type:=msoControlPopup, Befo=iIndex) With mnu .Caption = "Craig" .OnAction = "ShowExtractorForm" End With Set cb = Nothing End Sub Private Sub ShowExtractorForm() frmExtractData.Show End Sub *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
user form | Excel Discussion (Misc queries) | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
user form | New Users to Excel | |||
user form | Excel Discussion (Misc queries) | |||
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form | Excel Programming |