ClimoC
Well-known Member
- Joined
- Aug 21, 2009
- Messages
- 584
I'm getting there... slowly.
I have no problem with the XML. That's all fine.
My checkBoxes are linked to 3 cells in a data-store sheet. Click the checkbox, and the value is set in the datasheet to true/false, reflecting the checkbox.
But they always start as False. One of the checkboxes I'd like to default to True
Current Ribbon VB code:
So I'd assume that either when the Ribbon is invalidated to update, or at least just once during my workbook_open script, I throw in Call somewhere.
Helpy?
Thanks
C
I have no problem with the XML. That's all fine.
My checkBoxes are linked to 3 cells in a data-store sheet. Click the checkbox, and the value is set in the datasheet to true/false, reflecting the checkbox.
But they always start as False. One of the checkboxes I'd like to default to True
Current Ribbon VB code:
Code:
Public MyRibbon As IRibbonUI
Public Declare Sub CopyMemory Lib "kernel32" Alias _
"RtlMoveMemory" (destination As Any, source As Any, _
ByVal length As Long)
Public Sub ribb******ed(ribbon As IRibbonUI)
' Store pointer to IRibbonUI
Dim lngRibPtr As Long
' Store the custom ribbon UI Id in a static variable.
' This is done once during load of UI. I.e. during workbook open.
Set guiRibbon = ribbon
lngRibPtr = ObjPtr(ribbon)
' Write pointer to worksheet for safe keeping
Thisworkbook.Sheets("GridData").Range("E10").Value = lngRibPtr
ShwKeyDates = True
End Sub
Function GetRibbon(lngRibPtr As Long) As Object
Dim objRibbon As Object
CopyMemory objRibbon, lngRibPtr, 4
Set GetRibbon = objRibbon
Set objRibbon = Nothing
End Function
Public Sub RXReFire(Thisribbon As IRibbonUI)
Set MyRibbon = Thisribbon
End Sub
Public Sub RefreshRibbon()
If Not (MyRibbon Is Nothing) Then
MyRibbon.Invalidate
ribb******ed MyRibbon
Else
Set MyRibbon = GetRibbon(CLng(Thisworkbook.Sheets("GridData").Range("E10").Value))
MyRibbon.Invalidate
ribb******ed MyRibbon
End If
End Sub
Public Sub GetPressed(control As IRibbonControl, ByRef pressedState)
Select Case control.ID
Case "SeriesInSlotChk"
If Thisworkbook.Sheets("GridData").Range("D6").Value = "TRUE" Then
pressedState = True
End If
Case "ShowKeyDates"
If Thisworkbook.Sheets("GridData").Range("D7").Value = "TRUE" Then
pressedState = True
End If
Case "ShwKeyDates"
If Thisworkbook.Sheets("GridData").Range("E7").Value = "TRUE" Then
pressedState = True
End If
End Select
End Sub
Public Sub ClickAction(control As IRibbonControl, pressed As Boolean)
Select Case control.ID
Case "SeriesInSlotChk"
If pressed = True Then
Thisworkbook.Sheets("GridData").Range("E6").Value = "TRUE"
ElseIf pressed = False Then
Thisworkbook.Sheets("GridData").Range("E6").Value = "FALSE"
End If
Case "ShwKeyDates"
If pressed = True Then
Thisworkbook.Sheets("GridData").Range("E7").Value = "TRUE"
ElseIf pressed = False Then
Thisworkbook.Sheets("GridData").Range("E7").Value = "FALSE"
End If
Case "EpNumInSlotChk"
If pressed = True Then
Thisworkbook.Sheets("GridData").Range("E8").Value = "TRUE"
ElseIf pressed = False Then
Thisworkbook.Sheets("GridData").Range("E8").Value = "FALSE"
End If
End Select
End Sub
So I'd assume that either when the Ribbon is invalidated to update, or at least just once during my workbook_open script, I throw in Call somewhere.
Helpy?
Thanks
C