Good day everyone!
There is a file (in the application) that, using macros, allows you to create authorization with different levels of access to different sheets of the book.
The essence of the problem is this: the file works fine on Windows, it also works on a MacBook up to 2017 inclusive in office 16. The selection of Macs is not very large, where I tried to open it, but on MacBooks older than 17 years old, when opening the file, the message "Invalid procedure call or argument" appears and Visual Basic opens with the red line highlighted in yellow below.
This code is written in ThisWorkBook.
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Dim wsSh As Worksheet
Sheets(sWarning).Visible = -1
For Each wsSh In thisWorkbook.Sheets
If wsSh.Name <> sWarning Then wsSh.Visible = 2
Next wsSh
Application.ScreenUpdating = 1
thisWorkbook.Save
End Sub
Private Sub Workbook_Open()
Application.ScreenUpdating = False
thisWorkbook.Sheets(sMainSheet).Visible = -1
thisWorkbook.Sheets(sWarning).Visible = 2
Application.ScreenUpdating = 1
frmIndicateUser.Show
End Sub
Offices were 16 and 19. The names of all modules seemed to be written in Latin. Macros were enabled on all MacBooks. Has anyone encountered this problem, or can they help get it to run on any Mac? Thank you very much in advance for your advice))
For the default login, the login is Admin, the password is 1.
Bookmarks