Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to execute macro when selecting user-defined menu in ribbon

Hi!

I would like to know how to automatically execute a macro when I
select a user-defined tab I created in my Excel ribbon.

I tried onAction tag in my ribbon code for my menu:
<menu id="DropdownBD7020" label="BM7020" size="large"
imageMso="ControlsGallery" onAction="MacroName"

but that doesn't work.


Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default How to execute macro when selecting user-defined menu in ribbon

Matthieu,

I take it you are creating a dropdown in the ribbon in XML.

Can you post the whole XML and the callback code that you have?

--

HTH

Bob

"Mathieu936" wrote in message
...
Hi!

I would like to know how to automatically execute a macro when I
select a user-defined tab I created in my Excel ribbon.

I tried onAction tag in my ribbon code for my menu:
<menu id="DropdownBD7020" label="BM7020" size="large"
imageMso="ControlsGallery" onAction="MacroName"

but that doesn't work.


Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to execute macro when selecting user-defined menu in ribbon

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
<ribbon
<tabs
<!-- Add-Ins Ribbon Menu --
<tab id="SpecialFunctionsTab" label="My Special Functions"

<!-- Structural Analysis Library Tools Group --
<group id="GroupBD7020" label="BM7020"


<!-- BD7020 Dropdown --
<menu id="DropdownBD7020" label="BM7020 Manual" size="large"
imageMso="ControlsGallery"

<menu id="Menu01GeneralInformation" label="01 General
Information"
<menu id="Menu02StressReportFormat" label="02 Stress
Report Format"
<button id="ReportPWC" label="Stress Report"
onAction="InsertTool" /
</menu
</menu

</menu

</group
</tab
</tabs
</ribbon
</customUI
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to execute macro when selecting user-defined menu in ribbon

On 9 juin, 10:10, Mathieu936 wrote:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
*<ribbon
* * <tabs
* * * <!-- Add-Ins Ribbon Menu --
* * * <tab id="SpecialFunctionsTab" label="My Special Functions"

* * * * *<!-- Structural Analysis Library Tools Group --
* * * * *<group id="GroupBD7020" label="BM7020"

* * * * * <!-- BD7020 Dropdown --
* * * * * <menu id="DropdownBD7020" label="BM7020 Manual" size="large"
imageMso="ControlsGallery"

* * * * * * <menu id="Menu01GeneralInformation" label="01 General
Information"
* * * * * * * *<menu id="Menu02StressReportFormat" label="02 Stress
Report Format"
* * * * * * * * * * *<button id="ReportPWC" label="Stress Report"
onAction="InsertTool" /
* * * * * * * * * *</menu
* * * * * * * * </menu

* * * * * * </menu

* * * * *</group
* * * </tab
* * </tabs
* </ribbon
</customUI


any idea?

I would like to change the line <tab id="SpecialFunctionsTab"
label="My Special Functions" for <tab id="SpecialFunctionsTab"
label="My Special Functions" onAction="MyMacro"

However it does'nt work. I tried onAction, onClick, onSelect,
onActivate but nothing works :-(
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to execute macro when selecting user-defined menu in ribbon

If you use a dynamicMenu tag instead of a menu tag, you name a callback
that runs VBA to generate the menu. Within this VBA you could call the
other code you want to run.

I don't know the details off the top of my head, but i made it work
recently based on what's in the book RibbonX by Hennig, Martin, and Puls.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
774-275-0064
http://peltiertech.com/


On 6/9/2010 9:46 AM, Mathieu936 wrote:
Hi!

I would like to know how to automatically execute a macro when I
select a user-defined tab I created in my Excel ribbon.

I tried onAction tag in my ribbon code for my menu:
<menu id="DropdownBD7020" label="BM7020" size="large"
imageMso="ControlsGallery" onAction="MacroName"

but that doesn't work.


Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to execute macro when selecting user-defined menu in ribbon

On 10 juin, 22:39, Jon Peltier wrote:
If you use a dynamicMenu tag instead of a menu tag, you name a callback
that runs VBA to generate the menu. Within this VBA you could call the
other code you want to run.

I don't know the details off the top of my head, but i made it work
recently based on what's in the book RibbonX by Hennig, Martin, and Puls.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
774-275-0064http://peltiertech.com/

On 6/9/2010 9:46 AM, Mathieu936 wrote:



Hi!


I would like to know how to automatically execute a macro when I
select a user-defined tab I created in my Excel ribbon.


I tried onAction tag in my ribbon code for my menu:
<menu id="DropdownBD7020" label="BM7020" size="large"
imageMso="ControlsGallery" onAction="MacroName"


but that doesn't work.


Thanks!- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -


Okay thanks, I'll check what I can do..
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default How to execute macro when selecting user-defined menu in ribbon

I tried to create a workbook with your XML, but it didn't generate the
ribbon for some reason.

--

HTH

Bob

"Mathieu936" wrote in message
...
On 9 juin, 10:10, Mathieu936 wrote:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
<ribbon
<tabs
<!-- Add-Ins Ribbon Menu --
<tab id="SpecialFunctionsTab" label="My Special Functions"

<!-- Structural Analysis Library Tools Group --
<group id="GroupBD7020" label="BM7020"

<!-- BD7020 Dropdown --
<menu id="DropdownBD7020" label="BM7020 Manual" size="large"
imageMso="ControlsGallery"

<menu id="Menu01GeneralInformation" label="01 General
Information"
<menu id="Menu02StressReportFormat" label="02 Stress
Report Format"
<button id="ReportPWC" label="Stress Report"
onAction="InsertTool" /
</menu
</menu

</menu

</group
</tab
</tabs
</ribbon
</customUI


any idea?

I would like to change the line <tab id="SpecialFunctionsTab"
label="My Special Functions" for <tab id="SpecialFunctionsTab"
label="My Special Functions" onAction="MyMacro"

However it does'nt work. I tried onAction, onClick, onSelect,
onActivate but nothing works :-(


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
Execute macro when active cell is in a defined area Spuds Glorious Spuds[_2_] Excel Programming 3 February 18th 09 05:18 PM
Can you do user defined Menu Macros in Excel like in Lotus? rcampling Excel Programming 1 December 30th 08 07:28 PM
Selecting a Whole User Defined Row Using VBA Mikey2005 Excel Programming 2 February 8th 06 05:14 PM
User Defined formula, selecting range [email protected] Excel Programming 3 January 5th 06 09:27 AM
User defined menu Glen Mettler[_4_] Excel Programming 2 November 24th 04 07:43 PM


All times are GMT +1. The time now is 07:55 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"