Consulting

Results 1 to 6 of 6

Thread: VBA Code problem for Excel 2016 on a mac

  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

  2. #2
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    X-posted here: https://www.mrexcel.com/forum/excel-...h-teacher.html

    Cross posting is against the rules without posting a link to the cross-post, please read them.
    Last edited by paulked; 01-25-2018 at 08:18 PM.
    Semper in excretia sumus; solum profundum variat.

  3. #3
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    You can't customise the menu bar in Excel 2016 on a Mac. I'd suggest you look into ribbon customisation instead.
    Be as you wish to seem

  4. #4
    Quote Originally Posted by Aflatoon View Post
    You can't customise the menu bar in Excel 2016 on a Mac. I'd suggest you look into ribbon customisation instead.
    Thank you Aflatoon and sorry for the delay to answer : I live in France

    I'm not good with VBA code. Is it easy to change it ? Or is it possible I put here "the whole code" and you can make the change for me ? I know "how to develop" the code but I don't know the word of code. But I'm condident in my capacities to copy / paste a right code.

    To summurize, if I put here the whole code, do you have the time and/or the competencies to change it ?

    Many thanks for your time and your answer, even if it's "no"

    Best regard

    José from France.

  5. #5
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    You can't do it in VBA. You need to modify the CustomUI part of the workbook's XML. See Ron de Bruin's site for more details and examples. (www.rondebruin.nl)
    Be as you wish to seem

  6. #6
    Thank you Aflatoon. Im' in contact with him and he tries to find a solution

    Best regard

    José

Posting Permissions

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