Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Execute My Code on Menu Option

Application.VBE.CommandBars.FindControl(ID:=2188). Execute

If I wish to execute my own function when the user selects the option:
FileSend toMail Receipient (as attachment)... the Correct ID # is 2188,
but how do I tell it to run "MySub" instead? The above line gives me an
error # 1004. Perhaps the OnAction will work, but I don't understand the
syntax for it. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 434
Default Execute My Code on Menu Option

hi, Mike !

Application.VBE.CommandBars.FindControl(ID:=2188). Execute
If I wish to execute my own function when the user selects the option:
FileSend toMail Receipient (as attachment)... the Correct ID # is 2188
but how do I tell it to run "MySub" instead?
The above line gives me an error # 1004.
Perhaps the OnAction will work, but I don't understand the syntax for it...


you probably need to use a class module, see this thread: http://tinyurl.com/6po44f

hth,
hector.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Execute My Code on Menu Option

I got it to work. Thanks!

"Héctor Miguel" wrote:

hi, Mike !

Application.VBE.CommandBars.FindControl(ID:=2188). Execute
If I wish to execute my own function when the user selects the option:
FileSend toMail Receipient (as attachment)... the Correct ID # is 2188
but how do I tell it to run "MySub" instead?
The above line gives me an error # 1004.
Perhaps the OnAction will work, but I don't understand the syntax for it...


you probably need to use a class module, see this thread: http://tinyurl.com/6po44f

hth,
hector.



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
How to assign PRINT option to execute a macro Zubair Excel Discussion (Misc queries) 3 February 5th 10 05:55 PM
Execute code from book1 of code from book2 Rick Excel Programming 4 June 5th 07 05:19 PM
ENTER keys to execute code to add menu Mark Warner[_2_] Excel Programming 1 August 25th 06 10:25 PM
Code won't execute... Jim Cone Excel Programming 1 August 20th 05 07:22 AM
Execute a menu command with VBA? Susan[_3_] Excel Programming 2 May 1st 04 07:45 AM


All times are GMT +1. The time now is 10:07 PM.

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"