Hi Experts,

I have an issue that I am not sure how to solve. I need to assign a macro to a Button in my Excel file, BUT, I need to assign when the file opens. I have an issue when the file is closed the button stays on the sheet but the macro gets stripped from the button. So, when the file opens I would like for the macro to get reassigned to the button. Below is what I have tried so far, but I am getting a run time error. Any thoughts or a new method would be greatly appreciated.

Thanks

Private Sub Workbook_Open()
'assign macros to shapes
    Dim shp As Shape
        For Each shp In ShtInput.Shapes
            If shp.Name = "LoadWScript" Then
                shp.OnAction = "LoadSetup"
            
           End If
    Next shp
End Sub