EXCEL macros with Windows and MacOs

Pol Arenas 0 Reputation points
2023-03-10T17:05:12.2733333+00:00

I have an Excel file that several colleagues share.

On windows the file macros work perfectly but on Mac systems they don't. (Windows macros detect them but not on Mac)

I leave the macro below:

Sub AfegirSilla() 

 

    Dim Pregunta As String 

     

    Application.Goto Reference:="tSilla" 

    Selection.End(xlDown).Select 

 

    Pregunta = MsgBox( _ 

    "¿Añadir una fila vacía al final de la tabla de SILLAS?", _ 

    vbYesNo + vbQuestion, "S I L L A S") 

 

    If Pregunta = vbNo Then 

        Exit Sub 

    End If 

 

    ActiveSheet.Unprotect 

    Selection.ListObject.ListRows.Add AlwaysInsert:=True 

         

    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, _ 

    AllowSorting:=True, AllowFiltering:=True 

     

    ActiveCell.Offset(1, 0).Select 

     

End Sub 

Sub AfegirAlumne() 

 

    Dim Pregunta As String 

     

    Application.Goto Reference:="tAlumno" 

    Selection.End(xlDown).Select 

 

    Pregunta = MsgBox( _ 

    "¿Añadir una fila vacía al final de la tabla de ALUMNOS?", _ 

    vbYesNo + vbQuestion, "A L U M N OS") 

 

    If Pregunta = vbNo Then 

        Exit Sub 

    End If 

 

    ActiveSheet.Unprotect 

    Selection.ListObject.ListRows.Add AlwaysInsert:=True 

         

    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, _ 

    AllowSorting:=True, AllowFiltering:=True 

     

    ActiveCell.Offset(1, 0).Select 

     

End Sub
Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
3,726 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,435 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,453 questions
Office Mac
Office Mac
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Mac: A family of Apple personal computers that run the macOS operating system.
456 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,637 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Pol Arenas 0 Reputation points
    2023-03-11T11:05:11.1733333+00:00

    It doesn't give me any errors, it just doesn't detect the macro, I have the Mac shortcut of cmd ctrl + shift + A.

    In windows it detects the macro without any problem and I can execute it. in macos i can't run.


  2. Oskar Shon 866 Reputation points MVP
    2023-03-15T22:15:12.22+00:00

    You shouldn't count on VBA on mac...
    Regards.

    0 comments No comments