|
|
how can I disable a control in the ribbon at run time
As an example, in Excel 2007, I have 5 buttons on the ribbon. When I press a
button, it runs code and then it is meant to disable the button. Do you know
how I could do this? Any help would be appreciated.
|
|
0
|
|
|
|
Reply
|
Utf
|
1/15/2010 11:16:07 PM |
|
Hi irvy
See
http://www.rondebruin.nl/hidevisible.htm
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"irvy" <irvy@discussions.microsoft.com> wrote in message news:263AA8E7-98F0-4999-BC5B-E249253013AB@microsoft.com...
> As an example, in Excel 2007, I have 5 buttons on the ribbon. When I press a
> button, it runs code and then it is meant to disable the button. Do you know
> how I could do this? Any help would be appreciated.
|
|
0
|
|
|
|
Reply
|
Ron
|
1/15/2010 11:28:39 PM
|
|
Hey Ron,
Thanks for the quick reply. I have checked out your examples. What
they do is actually make the controls invisible. I still want to see
the control but want it disabled. Is that possible?
irvy
|
|
0
|
|
|
|
Reply
|
Irvy
|
1/19/2010 6:40:34 AM
|
|
Hi Ron,
I am still having some problems. I am just testing out the process
before I proceed with my actual code but I am getting this error:
"Runtime 91. Object variable or With block variable not set"
Can you tell me why I am getting this error?
Here is my xml code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI onLoad="RibbonOnLoad" xmlns="http://schemas.microsoft.com/
office/2006/01/customui">
<ribbon>
<tabs>
<tab idMso="TabHome" >
<group id="grp1" label="Group1" tag="MyPersonalGroup" >
<button id="btn1" label="button1" size="large"
onAction="disableBtn1" getEnabled="GetEnabled"
imageMso="DirectRepliesTo" />
<button id="btn2" label="button2" size="large"
onAction="disableBtn2" getEnabled="GetEnabled" imageMso="AccountMenu" /
>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
and here is my vba code:
Option Explicit
Dim Rib As IRibbonUI
'Callback for customUI.onLoad
Sub RibbonOnLoad(ribbon As IRibbonUI)
Set Rib = ribbon
End Sub
'Callback for btn1 getEnabled
Sub GetEnabled(control As IRibbonControl, ByRef returnedVal)
returnedVal = True
End Sub
'Callback for btn1 onAction
Sub disableBtn1(control As IRibbonControl)
Dim Rib As IRibbonUI
Rib.InvalidateControl ("btn1")
End Sub
'Callback for btn2 onAction
Sub disableBtn2(control As IRibbonControl)
Dim Rib As IRibbonUI
Rib.InvalidateControl ("btn2")
End Sub
|
|
0
|
|
|
|
Reply
|
Irvy
|
1/22/2010 8:48:45 AM
|
|
|
3 Replies
1101 Views
(page loaded in 0.104 seconds)
Similiar Articles: how can I disable a control in the ribbon at run time - microsoft ...As an example, in Excel 2007, I have 5 buttons on the ribbon. When I press a button, it runs code and then it is meant to disable the button. Do you... Ribbon run time error - microsoft.public.office.mischow can I disable a control in the ribbon at run time - microsoft ... Word 2007 Forms - Plain Text Control does not accept unless you Ta ... It is a ... Disable button on custom ribbon - microsoft.public.access ...how can I disable a control in the ribbon at run time - microsoft ... Disable button on custom ribbon - microsoft.public.access ... i had a hard time at first too so maybe ... Create OptionButton at run time - microsoft.public.excel ...how can I disable a control in the ribbon at run time - microsoft ... How can I switch off auto-hide ribbon (Quick Access Toolbar ... how can I disable a control in the ... How can I switch off auto-hide ribbon (Quick Access Toolbar ...I had a hard time moving it back because I wasn't ... How to hide or disable toolbars and ribbon in word with vba or vb6 ... How can I switch off auto-hide ribbon ... Disable Minimize/Maximize button for Excel 2007 Application ...... procedure restores the Control menu. >'Note that to run ... >>Sub Disable_Control() >> Dim X As ... 2007 Minimize/Maximize Ribbon - microsoft.public.access ... Disable ... Can't find my functions - microsoft.public.accesshow can I disable a control in the ribbon at run time - microsoft ... Can't find my functions - microsoft.public.access When setting up a ribbon I can't find the functions ... How can I disable entourage? - microsoft.public.mac.office ...how can I disable a control in the ribbon at run time - microsoft ... As an example, in Excel 2007, I have 5 buttons on the ribbon. When I press a button, it runs code and ... Enable/disable toolbar items - microsoft.public.access.formscoding ...how can I disable a control in the ribbon at run time - microsoft ... Customize Quick Access Toolbar, Ribbon UI, control and ... I use the code ... Ribbon idMso for TabHome? - microsoft.public.accesshow can I disable a control in the ribbon at run time - microsoft ... As an example, in Excel 2007, I have 5 buttons on the ribbon. When I press a ... com/ office/2006/01 ... how can I disable a control in the ribbon at run time - microsoft ...As an example, in Excel 2007, I have 5 buttons on the ribbon. When I press a button, it runs code and then it is meant to disable the button. Do you... how can I disable a control in the ribbon at run time ExcelAs an example, in Excel 2007, I have 5 buttons on the ribbon. When I press a button, it runs code and then it is meant to disable the button. Do you know how can I disable a control in the ribbon at run timeAs an example, in Excel 2007, I have 5 buttons on the ribbon. When I press a button, it runs code and then it is meant to disable the button. Do you know Walkthrough: Updating the Controls on a Ribbon at Run TimeCreating a new Outlook add-in project. Designing a custom Ribbon group. Adding the custom group to a built-in tab. Updating controls on the Ribbon at run time. Accessing the Ribbon at Run Time - Microsoft Corporation: Software ...You can write code to show, hide, and modify the Ribbon, and enable users to run the code from controls in a ... Accessing the Ribbon at Run Time 7/19/2012 7:53:39 PM
|
|
|
|
|
|
|
|
|