Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default RibbonX and a "macro may not be available" head-scratcher

So I have a simple .xlsm file with a couple very simple macros in it.
I've edited the customUI with the following code:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
<ribbon startFromScratch="true"
<tabs
<tab id="CustomTab" label="Trial Tab"
<group id="SimpleControls" label="Trial Group"
<button id="Button1" imageMso="HappyFace" size="large"
label="Say Hi"
onAction="sayHi3" /
<button id="Button2" imageMso="HappyFace" size="large"
label="ThisSayHi3"
onAction="Thisworkbook.sayHi3" /
</group
</tab
</tabs
</ribbon
</customUI

When I open it, sure enough the tab is there with two buttons. When I
hit the "Say hi" one I get the message: "Wrong number of arguments or
invalid property assignment" which is reasonable I guess since I
haven't qualified the macro name. Hitting the "ThisSayHi3" button
gives the message "Cannot run the macro "Thisworkbook.sayHi3". The
macro may not be avialable in this workbook or all macros may be
disabled." This is more mysterious. The macro is there; macros are
enabled; and it runs fine using F5 within the VB Editor. It's a just
one-liner at this point invoking MsgBox().
I haven't found anything useful relating to this message on the
Microsoft site, or MSDN, or (sigh) here. (The conditions mentiond in
support.microsoft.com/kb/930076 article dosn't apply here.) So, while
I suspect it's something blatantly obvious to others who know this
RibbonX, it's baffling to me. Any hints out there about what's going
on here?

= Marchand =

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default RibbonX and a "macro may not be available" head-scratcher

I don't have xl2007 installed, but Ron de Bruin has put up a page on working
with the ribbon. Perhaps you will see something in his working code:

http://www.rondebruin.nl/ribbon.htm

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
So I have a simple .xlsm file with a couple very simple macros in it.
I've edited the customUI with the following code:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
<ribbon startFromScratch="true"
<tabs
<tab id="CustomTab" label="Trial Tab"
<group id="SimpleControls" label="Trial Group"
<button id="Button1" imageMso="HappyFace" size="large"
label="Say Hi"
onAction="sayHi3" /
<button id="Button2" imageMso="HappyFace" size="large"
label="ThisSayHi3"
onAction="Thisworkbook.sayHi3" /
</group
</tab
</tabs
</ribbon
</customUI

When I open it, sure enough the tab is there with two buttons. When I
hit the "Say hi" one I get the message: "Wrong number of arguments or
invalid property assignment" which is reasonable I guess since I
haven't qualified the macro name. Hitting the "ThisSayHi3" button
gives the message "Cannot run the macro "Thisworkbook.sayHi3". The
macro may not be avialable in this workbook or all macros may be
disabled." This is more mysterious. The macro is there; macros are
enabled; and it runs fine using F5 within the VB Editor. It's a just
one-liner at this point invoking MsgBox().
I haven't found anything useful relating to this message on the
Microsoft site, or MSDN, or (sigh) here. (The conditions mentiond in
support.microsoft.com/kb/930076 article dosn't apply here.) So, while
I suspect it's something blatantly obvious to others who know this
RibbonX, it's baffling to me. Any hints out there about what's going
on here?

= Marchand =



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default RibbonX and a "macro may not be available" head-scratcher

Tom,


On Feb 1, 7:54 pm, "Tom Ogilvy" wrote:
I don't have xl2007 installed, but Ron de Bruin has put up a page on working
with the ribbon. Perhaps you will see something in his working code:

http://www.rondebruin.nl/ribbon.htm

--
Regards,
Tom Ogilvy

wrote in message

oups.com...

So I have a simple .xlsm file with a couple very simple macros in it.
I've edited the customUI with the following code:


<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
<ribbon startFromScratch="true"
<tabs
<tab id="CustomTab" label="Trial Tab"
<group id="SimpleControls" label="Trial Group"
<button id="Button1" imageMso="HappyFace" size="large"
label="Say Hi"
onAction="sayHi3" /
<button id="Button2" imageMso="HappyFace" size="large"
label="ThisSayHi3"
onAction="Thisworkbook.sayHi3" /
</group
</tab
</tabs
</ribbon
</customUI


When I open it, sure enough the tab is there with two buttons. When I
hit the "Say hi" one I get the message: "Wrong number of arguments or
invalid property assignment" which is reasonable I guess since I
haven't qualified the macro name. Hitting the "ThisSayHi3" button
gives the message "Cannot run the macro "Thisworkbook.sayHi3". The
macro may not be avialable in this workbook or all macros may be
disabled." This is more mysterious. The macro is there; macros are
enabled; and it runs fine using F5 within the VB Editor. It's a just
one-liner at this point invoking MsgBox().
I haven't found anything useful relating to this message on the
Microsoft site, or MSDN, or (sigh) here. (The conditions mentiond in
support.microsoft.com/kb/930076 article dosn't apply here.) So, while
I suspect it's something blatantly obvious to others who know this
RibbonX, it's baffling to me. Any hints out there about what's going
on here?


=Marchand=



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default RibbonX and a "macro may not be available" head-scratcher

Tom,

Thanks for the reference. Hasn't helped, but there's definitely a
lot of useful stuff there.

= M =

On Feb 1, 7:54 pm, "Tom Ogilvy" wrote:
I don't have xl2007 installed, but Ron de Bruin has put up a page on working
with the ribbon. Perhaps you will see something in his working code:

http://www.rondebruin.nl/ribbon.htm

--
Regards,
Tom Ogilvy

wrote in message

oups.com...

So I have a simple .xlsm file with a couple very simple macros in it.
I've edited the customUI with the following code:


<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
<ribbon startFromScratch="true"
<tabs
<tab id="CustomTab" label="Trial Tab"
<group id="SimpleControls" label="Trial Group"
<button id="Button1" imageMso="HappyFace" size="large"
label="Say Hi"
onAction="sayHi3" /
<button id="Button2" imageMso="HappyFace" size="large"
label="ThisSayHi3"
onAction="Thisworkbook.sayHi3" /
</group
</tab
</tabs
</ribbon
</customUI


When I open it, sure enough the tab is there with two buttons. When I
hit the "Say hi" one I get the message: "Wrong number of arguments or
invalid property assignment" which is reasonable I guess since I
haven't qualified the macro name. Hitting the "ThisSayHi3" button
gives the message "Cannot run the macro "Thisworkbook.sayHi3". The
macro may not be avialable in this workbook or all macros may be
disabled." This is more mysterious. The macro is there; macros are
enabled; and it runs fine using F5 within the VB Editor. It's a just
one-liner at this point invoking MsgBox().
I haven't found anything useful relating to this message on the
Microsoft site, or MSDN, or (sigh) here. (The conditions mentiond in
support.microsoft.com/kb/930076 article dosn't apply here.) So, while
I suspect it's something blatantly obvious to others who know this
RibbonX, it's baffling to me. Any hints out there about what's going
on here?


=Marchand=



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default RibbonX and a "macro may not be available" head-scratcher

Hi M

When you click on the "generate callbacks button it create the macros for you
Copy/paste them in a module in your workbook and add the code

There is a note about this in the xml examples


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


wrote in message oups.com...
Tom,

Thanks for the reference. Hasn't helped, but there's definitely a
lot of useful stuff there.

= M =

On Feb 1, 7:54 pm, "Tom Ogilvy" wrote:
I don't have xl2007 installed, but Ron de Bruin has put up a page on working
with the ribbon. Perhaps you will see something in his working code:

http://www.rondebruin.nl/ribbon.htm

--
Regards,
Tom Ogilvy

wrote in message

oups.com...

So I have a simple .xlsm file with a couple very simple macros in it.
I've edited the customUI with the following code:


<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
<ribbon startFromScratch="true"
<tabs
<tab id="CustomTab" label="Trial Tab"
<group id="SimpleControls" label="Trial Group"
<button id="Button1" imageMso="HappyFace" size="large"
label="Say Hi"
onAction="sayHi3" /
<button id="Button2" imageMso="HappyFace" size="large"
label="ThisSayHi3"
onAction="Thisworkbook.sayHi3" /
</group
</tab
</tabs
</ribbon
</customUI


When I open it, sure enough the tab is there with two buttons. When I
hit the "Say hi" one I get the message: "Wrong number of arguments or
invalid property assignment" which is reasonable I guess since I
haven't qualified the macro name. Hitting the "ThisSayHi3" button
gives the message "Cannot run the macro "Thisworkbook.sayHi3". The
macro may not be avialable in this workbook or all macros may be
disabled." This is more mysterious. The macro is there; macros are
enabled; and it runs fine using F5 within the VB Editor. It's a just
one-liner at this point invoking MsgBox().
I haven't found anything useful relating to this message on the
Microsoft site, or MSDN, or (sigh) here. (The conditions mentiond in
support.microsoft.com/kb/930076 article dosn't apply here.) So, while
I suspect it's something blatantly obvious to others who know this
RibbonX, it's baffling to me. Any hints out there about what's going
on here?


=Marchand=





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default RibbonX and a "macro may not be available" head-scratcher

Thanks for your response, Ron. I'm now cycling back to this project
and worked out an answer to the problem. It's rather much of a kludge,
but apparently a sanctioned one (http://msdn.microsoft.com/msdnmag/
issues/07/02/ribbonx/). The trick seems to be NOT to use the all-too-
tempting "onAction" parameter in the XML file, but rather use the
(poorly documented) "Tag" parameter. Thus, if I re-write my XML to
look like this:

<button id="customButton1" label="sayHi Label" size="large"
onAction="RibbonXOnAction" imageMso="Bold" tag="sayHi" /

and include this macro in the VBA:

Sub RibbonXOnAction(button As IRibbonControl)
Application.Run button.Tag
End Sub

then the macro "sayHi" will run without complaint.
I certainly hope others can find easier, more direct ways of doing
something as simple as connecting a macro to a Ribbon button -- and if
so, that they share them -- but this is getting me started.

= Marchand =




On Feb 2, 3:31 pm, "Ron de Bruin" wrote:
Hi M

When you click on the "generate callbacks button it create the macros for you
Copy/paste them in a module in your workbook and add the code

There is a note about this in the xml examples

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

wrote in ooglegroups.com...
Tom,


Thanks for the reference. Hasn't helped, but there's definitely a
lot of useful stuff there.


= M =


On Feb 1, 7:54 pm, "Tom Ogilvy" wrote:
I don't have xl2007 installed, but Ron de Bruin has put up a page on working
with the ribbon. Perhaps you will see something in his working code:


http://www.rondebruin.nl/ribbon.htm


--
Regards,
Tom Ogilvy


wrote in message


groups.com...


So I have a simple .xlsm file with a couple very simple macros in it.
I've edited the customUI with the following code:


<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
<ribbon startFromScratch="true"
<tabs
<tab id="CustomTab" label="Trial Tab"
<group id="SimpleControls" label="Trial Group"
<button id="Button1" imageMso="HappyFace" size="large"
label="Say Hi"
onAction="sayHi3" /
<button id="Button2" imageMso="HappyFace" size="large"
label="ThisSayHi3"
onAction="Thisworkbook.sayHi3" /
</group
</tab
</tabs
</ribbon
</customUI


When I open it, sure enough the tab is there with two buttons. When I
hit the "Say hi" one I get the message: "Wrong number of arguments or
invalid property assignment" which is reasonable I guess since I
haven't qualified the macro name. Hitting the "ThisSayHi3" button
gives the message "Cannot run the macro "Thisworkbook.sayHi3". The
macro may not be avialable in this workbook or all macros may be
disabled." This is more mysterious. The macro is there; macros are
enabled; and it runs fine using F5 within the VB Editor. It's a just
one-liner at this point invoking MsgBox().
I haven't found anything useful relating to this message on the
Microsoft site, or MSDN, or (sigh) here. (The conditions mentiond in
support.microsoft.com/kb/930076 article dosn't apply here.) So, while
I suspect it's something blatantly obvious to others who know this
RibbonX, it's baffling to me. Any hints out there about what's going
on here?


=Marchand=



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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Change default in input box from "20" to "000000"? Have macro continue on to name sheet tab? StargateFanFromWork[_4_] Excel Programming 7 October 29th 06 11:46 AM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
"Clean Me" Macro is giving "#VALUE!" error in the Notes field. Ryan Watkins Excel Programming 1 June 11th 05 12:25 AM
Sending macro based e-mail with built-in "Heading" and "Text" Prabha Excel Programming 3 January 17th 05 02:11 PM


All times are GMT +1. The time now is 03:07 AM.

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"