# "Error, restart your workbook" on open from another workbook.



## JLouis (Mar 13, 2021)

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


----------



## JLouis (Apr 11, 2021)

Hello. I'm reposting this question in the hopes I can get some direction. I've added a screenshot. 

To summarize, if I open the WB seen below by itself, I do not get the error. If opened via VBA, the error occurs...twice. I'm looking for a fix or workaround to prevent the error from occurring.


----------



## Rubyhu (Wednesday at 8:38 AM)

Hi Louis, did you resolve the issues?


----------



## JLouis (Wednesday at 11:27 AM)

This question is from 2021, but yes, all is well. Thank you.


----------



## Rubyhu (Wednesday at 9:03 PM)

JLouis said:


> This question is from 2021, but yes, all is well. Thank you.


Hi JLouis, I have the same problem. Could you recall how you solve the problem and share with me? Thank you very much!


----------



## JLouis (Yesterday at 6:36 PM)

I don't recall the specifcs, but I think I started with debugging the code.


----------

