Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpDest As Any, lpSource As Any, ByVal cBytes&)
- Dim Ribbon As IRibbonUI
- Sub rb_onLoad(rib As IRibbonUI)
- Set Ribbon = rib
- Sheet1.Range("A1").Value = ObjPtr(rib)
- End Sub
- Function GetRibbon() As IRibbonUI
- If Ribbon Is Nothing Then
- Dim ribbonPointer As Long
- On Error GoTo errorhandler
- ribbonPointer = Sheet1.Range("A1").Value
- Call CopyMemory(Ribbon, ribbonPointer, 4)
- On Error GoTo 0
- End If
- Set GetRibbon = Ribbon
- errorhandler:
- End Function
- Sub Update()
- GetRibbon().Invalidate
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement