Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default executing an add in

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default executing an add in

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default executing an add in

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default executing an add in

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default executing an add in

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default executing an add in

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default executing an add in

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
executing a function? Ray Excel Discussion (Misc queries) 2 March 24th 07 07:37 PM
EXECUTING A FORMULA Theresa New Users to Excel 4 January 18th 07 06:09 PM
Auto_open not executing Lon Sarnoff Excel Programming 3 September 17th 05 04:23 PM
Workbook_Open() Not executing Dave is Miffed Excel Programming 3 January 15th 05 01:24 PM
Executing a formula? J S Excel Programming 1 November 15th 04 10:51 PM


All times are GMT +1. The time now is 12:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"