Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
created a form and saved it as an add-in. how do i call the form
userform1.show does not work. created a code module in the xls that opens the form, but that module is not available as a macro. i want to invoke the form from a button the toolbar. thanks -- Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
figured it out, in he assign macro i typed 'MyAddin.xla'!MyMacro and it
worked -- Gary "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... created a form and saved it as an add-in. how do i call the form userform1.show does not work. created a code module in the xls that opens the form, but that module is not available as a macro. i want to invoke the form from a button the toolbar. thanks -- Gary |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary
The normal way to access Add-In functionality is to use the Add-In's workbook_open event to add menu items (or toolbar buttons) that call the add-in's macros. These menu items are then removed again by the workbook_BeforeClose event. Hope this helps Rowan Gary Keramidas wrote: created a form and saved it as an add-in. how do i call the form userform1.show does not work. created a code module in the xls that opens the form, but that module is not available as a macro. i want to invoke the form from a button the toolbar. thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks rowan, sounds like the way to go. i found and adapted some code, but
it doesn't do anything/ i would like to have a button on the toolbar, just don't know how to create it. here is the code i tried to use in the workbook open even Private Sub Workbook_Open() Dim tBar, newButton On Error Resume Next CommandBars("FormEntry").Delete CommandBars.Add Name:="FormEntry" 'set a variable to refer to the CommandBar Set tBar = CommandBars("FormEntry") 'add a blank button to the CommandBar Set newButton = tBar.Controls.Add With newButton .Caption = "Enter Data" .OnAction = "Teller Form.xla!Run_Form" End With 'make the CommandBar visible With tBar .Visible = True .Left = 20 .Top = 20 End With End Sub -- Gary "Rowan Drummond" wrote in message ... Hi Gary The normal way to access Add-In functionality is to use the Add-In's workbook_open event to add menu items (or toolbar buttons) that call the add-in's macros. These menu items are then removed again by the workbook_BeforeClose event. Hope this helps Rowan Gary Keramidas wrote: created a form and saved it as an add-in. how do i call the form userform1.show does not work. created a code module in the xls that opens the form, but that module is not available as a macro. i want to invoke the form from a button the toolbar. thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary
Your code created a toolbar for me but the caption did not show. I think you need to set the button style. See the post here from Dave Peterson regarding creating toolbars: http://groups.google.co.uk/group/mic...6d67b1cc4a1f65 Hope this helps Rowan Gary Keramidas wrote: thanks rowan, sounds like the way to go. i found and adapted some code, but it doesn't do anything/ i would like to have a button on the toolbar, just don't know how to create it. here is the code i tried to use in the workbook open even Private Sub Workbook_Open() Dim tBar, newButton On Error Resume Next CommandBars("FormEntry").Delete CommandBars.Add Name:="FormEntry" 'set a variable to refer to the CommandBar Set tBar = CommandBars("FormEntry") 'add a blank button to the CommandBar Set newButton = tBar.Controls.Add With newButton .Caption = "Enter Data" .OnAction = "Teller Form.xla!Run_Form" End With 'make the CommandBar visible With tBar .Visible = True .Left = 20 .Top = 20 End With End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks rowan. i guess the code did work, when i went to customize, all the
commandbars i created were listed there, they just weren't visible. the code you pointed me to seems to work just fine. i don't need 3 buttons, i'll fix that, but i got my form to fire when i click a button. this way they can't click a button on the toolbar with the wrong workbook open an generate an error. it will only be available when the workbooks with this code attached. thanks again. -- Gary "Rowan Drummond" wrote in message ... Hi Gary Your code created a toolbar for me but the caption did not show. I think you need to set the button style. See the post here from Dave Peterson regarding creating toolbars: http://groups.google.co.uk/group/mic...6d67b1cc4a1f65 Hope this helps Rowan Gary Keramidas wrote: thanks rowan, sounds like the way to go. i found and adapted some code, but it doesn't do anything/ i would like to have a button on the toolbar, just don't know how to create it. here is the code i tried to use in the workbook open even Private Sub Workbook_Open() Dim tBar, newButton On Error Resume Next CommandBars("FormEntry").Delete CommandBars.Add Name:="FormEntry" 'set a variable to refer to the CommandBar Set tBar = CommandBars("FormEntry") 'add a blank button to the CommandBar Set newButton = tBar.Controls.Add With newButton .Caption = "Enter Data" .OnAction = "Teller Form.xla!Run_Form" End With 'make the CommandBar visible With tBar .Visible = True .Left = 20 .Top = 20 End With End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're welcome Gary.
One thing to note if you choose to use a toolbar rather than a menu is that depending on the settings you specify the user could close the toolbar meaning that they have no way to activate the form aside from closing and reopening the workbook. Regards Rowan Gary Keramidas wrote: thanks rowan. i guess the code did work, when i went to customize, all the commandbars i created were listed there, they just weren't visible. the code you pointed me to seems to work just fine. i don't need 3 buttons, i'll fix that, but i got my form to fire when i click a button. this way they can't click a button on the toolbar with the wrong workbook open an generate an error. it will only be available when the workbooks with this code attached. thanks again. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
executing a function? | Excel Discussion (Misc queries) | |||
EXECUTING A FORMULA | New Users to Excel | |||
Auto_open not executing | Excel Programming | |||
Workbook_Open() Not executing | Excel Programming | |||
Executing a formula? | Excel Programming |