Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Run macro from embedded object

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Just wondering what the code is to run a designated macro from an embedded button. For example, I have a macro "Calc" written in a module and instead of copying and pasting the code into the Button Click sub, can I write a "trigger" that runs that macro?
    Basically > Click Button > Button "calls" the Calc macro (and then any other macros I may want to run) Thanks in advance!

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hi, to call the calc macro from a button, you need to create a macro with the code
    Call Calc
    then, assign this macro to the button.
    Will

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    No, I don't want to run the macro from a toolbar button, I want to run it from a coded embedded button.

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    how d'you mean?

  5. #5
    New Member
    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I want to create a command button on my worksheet. Inside the code of that command button, I want to trigger a macro.

    ie.
    Private Sub CommandButton1_Click()
    "Trigger macro from here"
    End Sub

  6. #6
    Board Regular
    Join Date
    Mar 2002
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    can i ask why it needs to be within the actual button and not a macro connected to the button?

  7. #7
    New Member
    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That's just it... I want to know If I am able to call other macros from the code in a command button. This way I can call 2 or 3 macros by just clicking the button I have embedded.

  8. #8
    Board Regular
    Join Date
    Mar 2002
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    well yes then, you should be able to. have you tried with the call command?

  9. #9
    Board Regular
    Join Date
    Mar 2002
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    well yes then, you should be able to. have you tried with the call command?

  10. #10
    New Member
    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That's what I'm after... the syntax. What is the syntax for the call command?

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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