Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel 2007 Ribbon Check custom buttons

Hi all,

via xml i add a tab to a ribbon, say something like:

<tab id="myId1" lable="MyLable"
<group id="gr1"
<button id="myButton1" onAction="MySub1" lable="Test1"
<button id="myButton1" onAction="MySub1" lable="Test2"
</group
<group id="gr2"
<button id="myButton1" onAction="MySub2" lable="Test3"
<button id="myButton1" onAction="MySub2" lable="Test4"
</group
</tab

In my workbook i have now two subs

sub MySub1(control as IbRibbonControl)
'some action
end sub

sub MySub2(control as IbRibbonControl)
'some action
end sub

Now it could be possible, that sombody removes the xmlpart for group gr2.

How can i check in my Sub MySub1 if the group gr2 with the buttons with the
given id and onAction arguments exists?

Is there a way? I found only GetMso ... which won't help with own
definitions?

Any idea?

tx in advance
Alice




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Excel 2007 Ribbon Check custom buttons

On 20 Apr, 13:00, "Alice" wrote:
Hi all,

via xml i add a tab to a ribbon, say something like:

<tab id="myId1" lable="MyLable"
<group id="gr1"
<button id="myButton1" onAction="MySub1" lable="Test1"
<button id="myButton1" onAction="MySub1" lable="Test2"
</group
<group id="gr2"
<button id="myButton1" onAction="MySub2" lable="Test3"
<button id="myButton1" onAction="MySub2" lable="Test4"
</group
</tab

In my workbook i have now two subs

sub MySub1(control as IbRibbonControl)
'some action
end sub

sub MySub2(control as IbRibbonControl)
'some action
end sub

Now it could be possible, that sombody removes the xmlpart for group gr2.

How can i check in my Sub MySub1 if the group gr2 with the buttons with the
given id and onAction arguments exists?

Is there a way? I found only GetMso ... which won't help with own
definitions?

Any idea?

tx in advance
Alice


Alice,

If somebody has 'removed' the XML part then the group/buttons wont be
on the ribbon to trigger the macro so a check wont be necessary.

Or am l missing something?

Regards

Michael Beckinsale

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel 2007 Ribbon Check custom buttons


"michael.beckinsale" schrieb im
Newsbeitrag ups.com...
On 20 Apr, 13:00, "Alice" wrote:
Hi all,

via xml i add a tab to a ribbon, say something like:

<tab id="myId1" lable="MyLable"
<group id="gr1"
<button id="myButton1" onAction="MySub1" lable="Test1"
<button id="myButton1" onAction="MySub1" lable="Test2"
</group
<group id="gr2"
<button id="myButton1" onAction="MySub2" lable="Test3"
<button id="myButton1" onAction="MySub2" lable="Test4"
</group
</tab

In my workbook i have now two subs

sub MySub1(control as IbRibbonControl)
'some action
end sub

sub MySub2(control as IbRibbonControl)
'some action
end sub

Now it could be possible, that sombody removes the xmlpart for group

gr2.

How can i check in my Sub MySub1 if the group gr2 with the buttons with

the
given id and onAction arguments exists?

Is there a way? I found only GetMso ... which won't help with own
definitions?

Any idea?

tx in advance
Alice


Alice,

If somebody has 'removed' the XML part then the group/buttons wont be
on the ribbon to trigger the macro so a check wont be necessary.

Or am l missing something?

Regards

Michael Beckinsale

Hi Michael,
say you develop an add-in and you want to have a group with links to your
homepage or something like that.
Now if somebody removes this group you want to display a message in the
other procedure, that it is not the original add-in and exit the code.
Thats the reason behind.
Regards



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel 2007 Ribbon Check custom buttons

Lets say that you add a callback attribute to the button you want to know
exists like:

getVisible="MySpecialGetVisibleCall"

When the ribbon is created by Excel that sub will be called. It can then set
a public variable "IAmHere" to True.

If the button exists IAmHere will be True; if it does not the callback will
never be called so IAmHere will be False.

Of course sub MySpecialGetVisibleCall should set the return value to true.

--
Jim
"Alice" wrote in message
...

"michael.beckinsale" schrieb im
Newsbeitrag ups.com...
On 20 Apr, 13:00, "Alice" wrote:
Hi all,

via xml i add a tab to a ribbon, say something like:

<tab id="myId1" lable="MyLable"
<group id="gr1"
<button id="myButton1" onAction="MySub1" lable="Test1"
<button id="myButton1" onAction="MySub1" lable="Test2"
</group
<group id="gr2"
<button id="myButton1" onAction="MySub2" lable="Test3"
<button id="myButton1" onAction="MySub2" lable="Test4"
</group
</tab

In my workbook i have now two subs

sub MySub1(control as IbRibbonControl)
'some action
end sub

sub MySub2(control as IbRibbonControl)
'some action
end sub

Now it could be possible, that sombody removes the xmlpart for group

gr2.

How can i check in my Sub MySub1 if the group gr2 with the buttons with

the
given id and onAction arguments exists?

Is there a way? I found only GetMso ... which won't help with own
definitions?

Any idea?

tx in advance
Alice


Alice,

If somebody has 'removed' the XML part then the group/buttons wont be
on the ribbon to trigger the macro so a check wont be necessary.

Or am l missing something?

Regards

Michael Beckinsale

Hi Michael,
say you develop an add-in and you want to have a group with links to your
homepage or something like that.
Now if somebody removes this group you want to display a message in the
other procedure, that it is not the original add-in and exit the code.
Thats the reason behind.
Regards





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Its getting close

Hi Jim,
tx for this idea. Just simple as that.
I played a little bit arround, getVisible didn't liked me but getScreentip
worked fine.
It's not over yet, because still a unfriendly person could leave in the
button, just rename it an kicks away the onAction.
(Ok i can set the lable with a callback - but the Action?)
And i just couldn't figure out, how to get the onAction Argument back.

In former commandbar handling you could retrieve the onAction arguments,
here i don't know how.

This ribbon is in a few ways not easy to handle and not much information in
the help :-(

But thanks anyway an perhaps you have some more ideas.

Regards




"Jim Rech" schrieb im Newsbeitrag
...
Lets say that you add a callback attribute to the button you want to know
exists like:

getVisible="MySpecialGetVisibleCall"

When the ribbon is created by Excel that sub will be called. It can then

set
a public variable "IAmHere" to True.

If the button exists IAmHere will be True; if it does not the callback

will
never be called so IAmHere will be False.

Of course sub MySpecialGetVisibleCall should set the return value to true.

--
Jim
"Alice" wrote in message
...

"michael.beckinsale" schrieb im
Newsbeitrag ups.com...
On 20 Apr, 13:00, "Alice" wrote:
Hi all,

via xml i add a tab to a ribbon, say something like:

<tab id="myId1" lable="MyLable"
<group id="gr1"
<button id="myButton1" onAction="MySub1" lable="Test1"
<button id="myButton1" onAction="MySub1" lable="Test2"
</group
<group id="gr2"
<button id="myButton1" onAction="MySub2" lable="Test3"
<button id="myButton1" onAction="MySub2" lable="Test4"
</group
</tab

In my workbook i have now two subs

sub MySub1(control as IbRibbonControl)
'some action
end sub

sub MySub2(control as IbRibbonControl)
'some action
end sub

Now it could be possible, that sombody removes the xmlpart for group

gr2.

How can i check in my Sub MySub1 if the group gr2 with the buttons

with
the
given id and onAction arguments exists?

Is there a way? I found only GetMso ... which won't help with own
definitions?

Any idea?

tx in advance
Alice

Alice,

If somebody has 'removed' the XML part then the group/buttons wont be
on the ribbon to trigger the macro so a check wont be necessary.

Or am l missing something?

Regards

Michael Beckinsale

Hi Michael,
say you develop an add-in and you want to have a group with links to

your
homepage or something like that.
Now if somebody removes this group you want to display a message in the
other procedure, that it is not the original add-in and exit the code.
Thats the reason behind.
Regards









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Its getting close

Well I guess you're right if someone can edit your RibbonX ultimately there
is nothing you can do about it. Such a person could edit your VBA too since
even a protected project can be broken into.

As a developer I try to make it hard for users to accidentally screw up my
application. But I don't worry about someone deliberately doing so. I
can't stop them and they know they're doing it so they are on their own.

--
Jim
"Alice" wrote in message
...
Hi Jim,
tx for this idea. Just simple as that.
I played a little bit arround, getVisible didn't liked me but getScreentip
worked fine.
It's not over yet, because still a unfriendly person could leave in the
button, just rename it an kicks away the onAction.
(Ok i can set the lable with a callback - but the Action?)
And i just couldn't figure out, how to get the onAction Argument back.

In former commandbar handling you could retrieve the onAction arguments,
here i don't know how.

This ribbon is in a few ways not easy to handle and not much information
in
the help :-(

But thanks anyway an perhaps you have some more ideas.

Regards




"Jim Rech" schrieb im Newsbeitrag
...
Lets say that you add a callback attribute to the button you want to know
exists like:

getVisible="MySpecialGetVisibleCall"

When the ribbon is created by Excel that sub will be called. It can then

set
a public variable "IAmHere" to True.

If the button exists IAmHere will be True; if it does not the callback

will
never be called so IAmHere will be False.

Of course sub MySpecialGetVisibleCall should set the return value to
true.

--
Jim
"Alice" wrote in message
...

"michael.beckinsale" schrieb im
Newsbeitrag
ups.com...
On 20 Apr, 13:00, "Alice" wrote:
Hi all,

via xml i add a tab to a ribbon, say something like:

<tab id="myId1" lable="MyLable"
<group id="gr1"
<button id="myButton1" onAction="MySub1" lable="Test1"
<button id="myButton1" onAction="MySub1" lable="Test2"
</group
<group id="gr2"
<button id="myButton1" onAction="MySub2" lable="Test3"
<button id="myButton1" onAction="MySub2" lable="Test4"
</group
</tab

In my workbook i have now two subs

sub MySub1(control as IbRibbonControl)
'some action
end sub

sub MySub2(control as IbRibbonControl)
'some action
end sub

Now it could be possible, that sombody removes the xmlpart for group
gr2.

How can i check in my Sub MySub1 if the group gr2 with the buttons

with
the
given id and onAction arguments exists?

Is there a way? I found only GetMso ... which won't help with own
definitions?

Any idea?

tx in advance
Alice

Alice,

If somebody has 'removed' the XML part then the group/buttons wont be
on the ribbon to trigger the macro so a check wont be necessary.

Or am l missing something?

Regards

Michael Beckinsale

Hi Michael,
say you develop an add-in and you want to have a group with links to

your
homepage or something like that.
Now if somebody removes this group you want to display a message in the
other procedure, that it is not the original add-in and exit the code.
Thats the reason behind.
Regards









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Its getting close

Hi Jim,
i know, that people are able to break up vba codeprotection :-)
But i find it much easier for people to destroy customUI than handling an
hexeditor ;-)
But you'e right anyway. Normaly i use a dll for critical vba code.

But still i don't like it, that i can't prove the existenz of a ribbon part
and it's onAction.

Regards and tx again


"Jim Rech" schrieb im Newsbeitrag
...
Well I guess you're right if someone can edit your RibbonX ultimately

there
is nothing you can do about it. Such a person could edit your VBA too

since
even a protected project can be broken into.

As a developer I try to make it hard for users to accidentally screw up my
application. But I don't worry about someone deliberately doing so. I
can't stop them and they know they're doing it so they are on their own.

--
Jim
"Alice" wrote in message
...
Hi Jim,
tx for this idea. Just simple as that.
I played a little bit arround, getVisible didn't liked me but

getScreentip
worked fine.
It's not over yet, because still a unfriendly person could leave in the
button, just rename it an kicks away the onAction.
(Ok i can set the lable with a callback - but the Action?)
And i just couldn't figure out, how to get the onAction Argument back.

In former commandbar handling you could retrieve the onAction arguments,
here i don't know how.

This ribbon is in a few ways not easy to handle and not much information
in
the help :-(

But thanks anyway an perhaps you have some more ideas.

Regards




"Jim Rech" schrieb im Newsbeitrag
...
Lets say that you add a callback attribute to the button you want to

know
exists like:

getVisible="MySpecialGetVisibleCall"

When the ribbon is created by Excel that sub will be called. It can

then
set
a public variable "IAmHere" to True.

If the button exists IAmHere will be True; if it does not the callback

will
never be called so IAmHere will be False.

Of course sub MySpecialGetVisibleCall should set the return value to
true.

--
Jim
"Alice" wrote in message
...

"michael.beckinsale" schrieb im
Newsbeitrag
ups.com...
On 20 Apr, 13:00, "Alice" wrote:
Hi all,

via xml i add a tab to a ribbon, say something like:

<tab id="myId1" lable="MyLable"
<group id="gr1"
<button id="myButton1" onAction="MySub1" lable="Test1"
<button id="myButton1" onAction="MySub1" lable="Test2"
</group
<group id="gr2"
<button id="myButton1" onAction="MySub2" lable="Test3"
<button id="myButton1" onAction="MySub2" lable="Test4"
</group
</tab

In my workbook i have now two subs

sub MySub1(control as IbRibbonControl)
'some action
end sub

sub MySub2(control as IbRibbonControl)
'some action
end sub

Now it could be possible, that sombody removes the xmlpart for

group
gr2.

How can i check in my Sub MySub1 if the group gr2 with the buttons

with
the
given id and onAction arguments exists?

Is there a way? I found only GetMso ... which won't help with own
definitions?

Any idea?

tx in advance
Alice

Alice,

If somebody has 'removed' the XML part then the group/buttons wont

be
on the ribbon to trigger the macro so a check wont be necessary.

Or am l missing something?

Regards

Michael Beckinsale

Hi Michael,
say you develop an add-in and you want to have a group with links to

your
homepage or something like that.
Now if somebody removes this group you want to display a message in

the
other procedure, that it is not the original add-in and exit the

code.
Thats the reason behind.
Regards











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
Unable to see custom Ad-Ins ribbon tab in Excel 2007 + Windows 7 JoeU in Texas Excel Worksheet Functions 0 January 11th 10 07:01 PM
Not all Ribbon Buttons are available in Excel 2007 Bill Excel Discussion (Misc queries) 4 May 14th 09 03:47 PM
Radio buttons, check boxes in Excel 2007 smartgal Excel Discussion (Misc queries) 4 November 11th 08 06:52 PM
QAT Buttons and Ribbon Issues in Excel 2007 Ailish Excel Discussion (Misc queries) 1 May 9th 08 06:02 PM
make custom buttons for macros on quick access bar excel 2007 shieber Excel Discussion (Misc queries) 2 April 28th 08 03:57 PM


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