Hello,
When my workbook is opened as read only with macro's enabled the VBA gives an error when I wan't to close the workbook?
As you can see the beforeclose saves a copy to a specific location and a backup.
can this be solved by making it skip the code when the workbook is opened in read only mode??
Option Explicit Private Sub Workbook_Activate() ShowMenu End Sub 'Skip this when read only or something to prevent this code from running in read onlymode Private Sub Workbook_BeforeClose(Cancel As Boolean) RemoveMenu 'ThisWorkbook.SaveCopyAs "\\BER...1\Shared\" & "UT_BORDEN_" & Format(Now(), "DD.MMM.YYYY_hh.mm.ss") & ".xls" ThisWorkbook.SaveCopyAs "\\BER...1\Shared\....xls" ThisWorkbook.Save End Sub Private Sub Workbook_Deactivate() HideMenu End Sub Private Sub Workbook_Open() AddMenu End Sub
Bookmarks