Results 1 to 13 of 13

The macro Workbook_Open() does not work on macOS

Threaded View

  1. #1
    Registered User
    Join Date
    12-25-2023
    Location
    Moscow
    MS-Off Ver
    MS Office 16
    Posts
    6

    The macro Workbook_Open() does not work on macOS

    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.
    Attached Files Attached Files
    Last edited by alansidman; 12-25-2023 at 11:18 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MacOs - How to close code windows? AND how to reorder the debug bar [MacOS]
    By lord anubis in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 06-05-2022, 02:02 PM
  2. Macro work well on windows but Macos give error 91
    By mazan2010 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-30-2020, 04:10 PM
  3. Workbook_Open() won't work
    By Macro Daddy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-10-2010, 12:24 PM
  4. Workbook_Open doesn't work
    By Magic_Doctor in forum Excel General
    Replies: 2
    Last Post: 07-28-2009, 01:08 PM
  5. Workbook_open event doesn't work
    By sapphire in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-26-2008, 01:53 PM
  6. [SOLVED] Workbook_Open() does not work
    By Ken in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2006, 01:55 PM
  7. [SOLVED] Can't get Workbook_Open event to work
    By M Smith in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2005, 02:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1