Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to see custom Ad-Ins ribbon tab in Excel 2007 + Windows 7 | Excel Worksheet Functions | |||
Not all Ribbon Buttons are available in Excel 2007 | Excel Discussion (Misc queries) | |||
Radio buttons, check boxes in Excel 2007 | Excel Discussion (Misc queries) | |||
QAT Buttons and Ribbon Issues in Excel 2007 | Excel Discussion (Misc queries) | |||
make custom buttons for macros on quick access bar excel 2007 | Excel Discussion (Misc queries) |