I have a file which opens with the following:
Private Sub Workbook_open()
Application.DisplayFormulaBar = False
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayGridlines = False
Application.CommandBars.ExecuteMso "HideRibbon"
End Sub
When I run the file locally on my PC it works perfectly. After using the file I send it as an attachment to an email to another person. That person opens the file in protected mode
and after enabling editing and running the file they get the Run-time error '91': Object variable or With block variable not set error at lines 2 and 3, the ActiveWindow lines. Please can anyone suggest the reason for this and a solution to the problem?
Private Sub Workbook_open()
Application.DisplayFormulaBar = False
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayGridlines = False
Application.CommandBars.ExecuteMso "HideRibbon"
End Sub
When I run the file locally on my PC it works perfectly. After using the file I send it as an attachment to an email to another person. That person opens the file in protected mode
and after enabling editing and running the file they get the Run-time error '91': Object variable or With block variable not set error at lines 2 and 3, the ActiveWindow lines. Please can anyone suggest the reason for this and a solution to the problem?
VBA Code: