Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can i Create

Hi all,


I would like to add some menu Item based on the following code but it
returns failed. The reason is that i pass an parameter on "OnAction" which
excel file cannot find the macroname RunTest(1)

Here is my code
==========================================
MenuBars(xlWorksheet).Menus(menuName).MenuItems.Ad d Caption:=itemName,
OnAction:=RunTest(1)



Public Sub RunTest(ByVal iParameter as integer)
Msgbox(iParameter)
End Sub
===================================

What can i do?


Regards,
Norotn


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default How can i Create

Hi,

.OnAction:= "RunTest(1)"

--
Regards,
Soo Cheon Jheong

"Norton" wrote in message
...
Hi all,


I would like to add some menu Item based on the following code but it
returns failed. The reason is that i pass an parameter on "OnAction" which
excel file cannot find the macroname RunTest(1)

Here is my code
==========================================
MenuBars(xlWorksheet).Menus(menuName).MenuItems.Ad d Caption:=itemName,
OnAction:=RunTest(1)



Public Sub RunTest(ByVal iParameter as integer)
Msgbox(iParameter)
End Sub
===================================

What can i do?


Regards,
Norotn




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default How can i Create

Hello Norton
Since your macro takes a parameter, OnAction will not accept it as it is.
So provided Runtest will always take 1 on its parameter for the Onaction
method,I would suggest you create another macro to run your Runtest macro
and use this new macro name instead.

HTH
Cordially
Pascal

"Norton" a écrit dans le message de
...
Hi all,


I would like to add some menu Item based on the following code but it
returns failed. The reason is that i pass an parameter on "OnAction" which
excel file cannot find the macroname RunTest(1)

Here is my code
==========================================
MenuBars(xlWorksheet).Menus(menuName).MenuItems.Ad d Caption:=itemName,
OnAction:=RunTest(1)



Public Sub RunTest(ByVal iParameter as integer)
Msgbox(iParameter)
End Sub
===================================

What can i do?


Regards,
Norotn




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can i Create

Thx for your advise!


"Norton" wrote in message
...
Hi all,


I would like to add some menu Item based on the following code but it
returns failed. The reason is that i pass an parameter on "OnAction" which
excel file cannot find the macroname RunTest(1)

Here is my code
==========================================
MenuBars(xlWorksheet).Menus(menuName).MenuItems.Ad d Caption:=itemName,
OnAction:=RunTest(1)



Public Sub RunTest(ByVal iParameter as integer)
Msgbox(iParameter)
End Sub
===================================

What can i do?


Regards,
Norotn




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
Create a macro to create excel line graph with coloured pointers anddata lables anuj datta Charts and Charting in Excel 1 September 30th 09 04:04 PM
How to create adress list so can mail merge and create labels? adecocq Excel Discussion (Misc queries) 2 October 25th 06 12:32 AM
How to create a form to insert a hyerlink.VBA code to create a for karthi Excel Discussion (Misc queries) 0 July 5th 06 11:26 AM
Create dictionary of terms, create first time user site Solitaire Jane Austin New Users to Excel 1 January 19th 06 09:47 PM
need to create a formula to create a timesheet but haven't a clue AHurd Excel Discussion (Misc queries) 7 August 22nd 05 12:04 PM


All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"