ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   running a command button from a program (https://www.excelbanter.com/excel-programming/328744-running-command-button-program.html)

Pete at Sappi Fine Paper[_2_]

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?

HotRod

running a command button from a program
 
I think you can call the "CommandButton_Click" EVENT for each button to
launch what you want.



Pete at Sappi Fine Paper[_2_]

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.




Pete at Sappi Fine Paper

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.




Bob Phillips[_6_]

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"
wrote in message ...
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.






Pete at Sappi Fine Paper

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"
wrote in message ...
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.







Bob Phillips[_6_]

running a command button from a program
 
It's a pleasure Pete.

"Pete at Sappi Fine Paper"
wrote in message ...
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"


wrote in message

...
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.









HotRod

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.




All times are GMT +1. The time now is 04:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com