Results 1 to 6 of 6

Thread: VBA Code problem for Excel 2016 on a mac

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    VBA Code problem for Excel 2016 on a mac

    Hello all

    I’m not a very good user of Excel on Mac and i’m an occasional teacher (in France). For many long time, I use a macro called « Stataix » withe help me to draw dot plot graphic. I know it’s inside Excel’16 now but I can do some thing with this macro I can’t do usually with the new version of Excel. This major allways work with PC (my PC’s owner student are happy) but doesn’t work with a mac. Can you take 5 minutes to tell me if there’s a solution…Or if I need to find myself a way to correct it ?


    Many thanks for your possible answer.


    Best regard


    José
    Option Explicit
    Public Const APPNAME = "StatAix"
    Public Const APPVERSION = "1.2"
    Public Const StatAixCaption As String = APPNAME
    Public Const DBoitamouCaption As String = "Donnees Boîte à moustaches"
    Public Const DBoitamouMacro As String = "DonneesBoiteAMoustaches"
    Public Const GBoitamouCaption As String = "Graph Boîte à moustaches"
    Public Const GBoitamouMacro As String = "GraphBoiteAMoustaches"
    Public Const DesinstallerCaption As String = "Desinstaller"
    Public Const DesinstallerMacro As String = "Desinstaller"
    
    Sub CreateMenu()
    Dim XLCommandBar As Integer
    Dim NewMenu As CommandBarPopup
    Dim NewItem As CommandBarButton
    Dim ToolsMenu As CommandBarPop
    XLCommandBar = 1 'Worksheet Menu Bar
    ' This code handles non-English versions of Excel
    ' in which the 'Tools' menu has a different name
    Set ToolsMenu = CommandBars(XLCommandBar).FindControl(msoControlPopup, 30007)
    ' Delete the current menu if it exists (just in case)
    On Error Resume Next
    CommandBars(XLCommandBar).Controls(StatAixCaption).Delete
    On Error GoTo 0
    ' Create the new menu item
    Set NewMenu = CommandBars(XLCommandBar).Controls.Add(Type:=msoControlPopup) >>> This instruction doesn’t work on Mac. But works on a PC...
    NewMenu.Caption = StatAixCaption


    Last edited by Aussiebear; 03-22-2023 at 09:59 PM. Reason: Added code tags

Posting Permissions

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