Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access 2007 and the IRibbonUI object (Trying to Invalidate to force a refresh of RibbonX) - Re-Post

43 views
Skip to first unread message

Anthos

unread,
Dec 21, 2006, 3:27:11 PM12/21/06
to
I am having troubles invalidating a iRibbonUI object
Can someone please tell me what I am doing wrong.


RibbonXML =
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="ribbonLoaded">
<ribbon startFromScratch="false">
<tabs>
<tab id="DemoTab" label="LoadCustomUI Demo" visible = "true">
</tab>
</tabs>
</ribbon>
</customUI>


in MS Access I have this for the Callback for the ribbonLoaded
(I am sure my callback is where things are going wrong.)


Public Sub ribbonLoaded(ByVal RibbonUI As IRibbonUI)
gobjRibbon = RibbonUI
IRibbonUI.Invalidate
End Sub


Then to invalidate I am trying to use


Public Function Inval()
gobjRibbon.Invalidate
End Function


gobjRibbon is Public variant
(Public gobjRibbon)


Thank you for your help with this, it's been keeping me up late at
night.


The Error Message I get when trying to invalidate is
424 : Object Required.

Anthos

unread,
Dec 21, 2006, 3:28:37 PM12/21/06
to

Jeff Conrad

unread,
Dec 21, 2006, 4:14:25 PM12/21/06
to
Try:

Public gobjRibbon As IRibbonUI

Public Sub ribbonLoaded(ByVal Ribbon As IRibbonUI)
Set gobjRibbon = Ribbon
End Sub

Public Function Inval()
gobjRibbon.Invalidate
End Function

--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
Access 2007 Info: http://www.AccessJunkie.com

"Anthos" wrote in message:
news:1166732831.1...@i12g2000cwa.googlegroups.com...

Anthos

unread,
Dec 21, 2006, 8:09:55 PM12/21/06
to
Thank you,
That did the trick

I must be missing something though, becuase my understanding is that if
I invalidate a Ribbon, then it no longer exists, and I can rebuild it.
(making it dynamic)

Yet when I invalidate my ribbon in this instance, and then try and
re-apply it to a form, there is no change.

I run Inval then I run Application.LoadCustomUI "Testing", XML it tells
me the ribbon is already loaded.

Am I missing something?

How do I rebuild a ribbon from scratch?

Jeff Conrad

unread,
Dec 22, 2006, 11:20:40 AM12/22/06
to
Hi Anthos,

I haven't experimented yet with invalidating a whole ribbon.
I typically just invalidate a single control using the InvalidateControl technique:

gobjRibbon.InvalidateControl "ControlID"

"Anthos" wrote in message:
news:1166749795.5...@73g2000cwn.googlegroups.com...

0 new messages