Hello. Some of you may recognize this error. It is part of the custom ribbon code.
Sub RefreshRibbon(Tag As String)
MyTag = Tag
If Rib Is Nothing Then
MsgBox "Error, restart your workbook"
Else
Rib.Invalidate
End If
End Sub
'Note: Do not change the code above
I have a different workbook that opens this one and it throws this code when first opened. Cancel the error and the WB works fine without error. I think the error comes from the first worksheet that does not contain a custom ribbon code called "Home." I've tried several combinations of ribbon code that doesn't solve the problem. The "Home" worksheet does not have a custom ribbon.
This is the code to open the workbooks:
Workbooks.Open (CurDir & "\4 LELAND\NBO 1829 Schedule\1829 Scheduling Program.xlsm")
Workbooks.Open (CurDir & "\2 oleander\NBO 276 Schedule\276 Scheduling Program.xlsm")
This is part of the ribbon code in the "Private Sub Workbook_SheetActivate(ByVal Sh As Object)"
Case "Home": Call RefreshRibbon(Tag:="Home")
'Case "Home": Exit Sub (commented out)
I do not have any reference to the Home sheet in the custom xml code, although I added one to see if it would resolve the error but it did not. I subsequently removed the code from the xml.
Is there any modifications to my code that would keep the error from occurring on startup? When opening the workbook by itself it does not show the error.
Thank you for reading. Hope you can help.
Louis
Sub RefreshRibbon(Tag As String)
MyTag = Tag
If Rib Is Nothing Then
MsgBox "Error, restart your workbook"
Else
Rib.Invalidate
End If
End Sub
'Note: Do not change the code above
I have a different workbook that opens this one and it throws this code when first opened. Cancel the error and the WB works fine without error. I think the error comes from the first worksheet that does not contain a custom ribbon code called "Home." I've tried several combinations of ribbon code that doesn't solve the problem. The "Home" worksheet does not have a custom ribbon.
This is the code to open the workbooks:
Workbooks.Open (CurDir & "\4 LELAND\NBO 1829 Schedule\1829 Scheduling Program.xlsm")
Workbooks.Open (CurDir & "\2 oleander\NBO 276 Schedule\276 Scheduling Program.xlsm")
This is part of the ribbon code in the "Private Sub Workbook_SheetActivate(ByVal Sh As Object)"
Case "Home": Call RefreshRibbon(Tag:="Home")
'Case "Home": Exit Sub (commented out)
I do not have any reference to the Home sheet in the custom xml code, although I added one to see if it would resolve the error but it did not. I subsequently removed the code from the xml.
Is there any modifications to my code that would keep the error from occurring on startup? When opening the workbook by itself it does not show the error.
Thank you for reading. Hope you can help.
Louis