+ Reply to Thread
Results 1 to 7 of 7

executing an add in

  1. #1
    Gary Keramidas
    Guest

    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. #2
    Rowan Drummond
    Guest

    Re: 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
    >


  3. #3
    Gary Keramidas
    Guest

    Re: 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
    news:[email protected]...
    > 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
    >
    >
    >




  4. #4
    Gary Keramidas
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #5
    Rowan Drummond
    Guest

    Re: 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. #6
    Gary Keramidas
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #7
    Rowan Drummond
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1