+ Reply to Thread
Results 1 to 9 of 9

[SOLVED] running a command button from a program

  1. #1
    Pete at Sappi Fine Paper
    Guest

    [SOLVED] running a command button from a program

    I have a spreadsheet with many command buttons, each running code that takes
    several minutes to complete. I'm trying to create a "master button", which
    will run all of the other command buttons. You would think that a nice
    simple line like:

    cmdReport.Run

    .... would do the trick. Unfortunately that doesn't work, nor does anything
    else I have tried. The help files are not helpful on the subject and I can't
    find an answer online. Can anyone help?

  2. #2
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    Refer to your Visual Basic help topic on the Run method.

    Hope this helps,
    theDude

  3. #3
    HotRod
    Guest

    Re: running a command button from a program

    I think you can call the "CommandButton_Click" EVENT for each button to
    launch what you want.



  4. #4
    Pete at Sappi Fine Paper
    Guest

    Re: running a command button from a program

    You're a genius!

    And I'm an idiot...

    Thank you so much.

    "HotRod" wrote:

    > I think you can call the "CommandButton_Click" EVENT for each button to
    > launch what you want.
    >
    >
    >


  5. #5
    Pete at Sappi Fine Paper
    Guest

    Re: running a command button from a program

    Okay, next question: it works if the button is on the same sheet as the
    "master button", but what if the button is on another sheet? I tried:

    cmdReport_Click

    ....and...

    Worksheets("Sheet2").cmdReport_Click

    and I got an error 438 - "Object doesn't support this property or method".

    Any thoughts?

    "HotRod" wrote:

    > I think you can call the "CommandButton_Click" EVENT for each button to
    > launch what you want.
    >
    >
    >


  6. #6
    Bob Phillips
    Guest

    Re: running a command button from a program

    You need to make them Public.


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Pete at Sappi Fine Paper" <PeteatSappiFinePaper@discussions.microsoft.com>
    wrote in message news:99BFC5EB-86F9-4B2A-A05D-050A1C8624C7@microsoft.com...
    > Okay, next question: it works if the button is on the same sheet as the
    > "master button", but what if the button is on another sheet? I tried:
    >
    > cmdReport_Click
    >
    > ...and...
    >
    > Worksheets("Sheet2").cmdReport_Click
    >
    > and I got an error 438 - "Object doesn't support this property or method".
    >
    > Any thoughts?
    >
    > "HotRod" wrote:
    >
    > > I think you can call the "CommandButton_Click" EVENT for each button to
    > > launch what you want.
    > >
    > >
    > >




  7. #7
    Pete at Sappi Fine Paper
    Guest

    Re: running a command button from a program

    Thank you very much Bob - that worked!

    "Bob Phillips" wrote:

    > You need to make them Public.
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Pete at Sappi Fine Paper" <PeteatSappiFinePaper@discussions.microsoft.com>
    > wrote in message news:99BFC5EB-86F9-4B2A-A05D-050A1C8624C7@microsoft.com...
    > > Okay, next question: it works if the button is on the same sheet as the
    > > "master button", but what if the button is on another sheet? I tried:
    > >
    > > cmdReport_Click
    > >
    > > ...and...
    > >
    > > Worksheets("Sheet2").cmdReport_Click
    > >
    > > and I got an error 438 - "Object doesn't support this property or method".
    > >
    > > Any thoughts?
    > >
    > > "HotRod" wrote:
    > >
    > > > I think you can call the "CommandButton_Click" EVENT for each button to
    > > > launch what you want.
    > > >
    > > >
    > > >

    >
    >
    >


  8. #8
    Bob Phillips
    Guest

    Re: running a command button from a program

    It's a pleasure Pete.

    "Pete at Sappi Fine Paper" <PeteatSappiFinePaper@discussions.microsoft.com>
    wrote in message news:4AEF2165-3961-4DC6-81CD-D32DD656C4A8@microsoft.com...
    > Thank you very much Bob - that worked!
    >
    > "Bob Phillips" wrote:
    >
    > > You need to make them Public.
    > >
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Pete at Sappi Fine Paper"

    <PeteatSappiFinePaper@discussions.microsoft.com>
    > > wrote in message

    news:99BFC5EB-86F9-4B2A-A05D-050A1C8624C7@microsoft.com...
    > > > Okay, next question: it works if the button is on the same sheet as

    the
    > > > "master button", but what if the button is on another sheet? I tried:
    > > >
    > > > cmdReport_Click
    > > >
    > > > ...and...
    > > >
    > > > Worksheets("Sheet2").cmdReport_Click
    > > >
    > > > and I got an error 438 - "Object doesn't support this property or

    method".
    > > >
    > > > Any thoughts?
    > > >
    > > > "HotRod" wrote:
    > > >
    > > > > I think you can call the "CommandButton_Click" EVENT for each button

    to
    > > > > launch what you want.
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




  9. #9
    HotRod
    Guest

    Re: running a command button from a program

    Pete
    Don't beat yourself up. IF you search for all the messages I've posted
    you would noticed that the level of my intelligence is directly proportional
    to the number of hours my little kids slept the night before and the number
    of coffee's I've downed.

    I'm not sure if you know this but the news group is here to make some of
    use feel smart, some of the time.



+ 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