Are you losing the reference to your ribbon object?
You might try some variation of this:
Option Explicit
#If VBA7 Then
Public Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef destination As Any, ByRef source As Any, ByVal length As Long)
#Else
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef destination As Any, ByRef source As Any, ByVal length As Long)
#End If
Public p_oRibbon As IRibbonUI
Public Sub OnLoad(oRibbon As IRibbonUI)
Set p_oRibbon = oRibbon
ThisDocument.Variables("RXPointer") = ObjPtr(oRibbon)
ThisDocument.Saved = True
lbl_Exit:
Exit Sub
End Sub
Function GetRibbon() As Object
#If VBA7 Then
Dim lngRibPtr As LongPtr
lngRibPtr = CLngPtr(ThisDocument.Variables("RXPointer"))
#Else
Dim lngRibPtr As Long
lngRibPtr = CLng(ThisDocument.Variables("RXPointer"))
#End If
Dim oRibbon As Object
CopyMemory oRibbon, lngRibPtr, LenB(lngRibPtr)
Set GetRibbon = oRibbon
Set oRibbon = Nothing
lbl_Exit:
Exit Function
End Function
Sub AutoClose()
ClearRibbonMemory
lbl_Exit:
Exit Sub
End Sub
Sub ClearRibbonMemory()
Set p_oRibbon = Nothing
lbl_Exit:
Exit Sub
End Sub
Sub Test()
If p_oRibbon Is Nothing Then Set p_oRibbon = GetRibbon
p_oRibbon.InvalidateControl "G3EditBox001"
End Sub