Excel for mac hide ribbon












0














I'm developing a VBA program on top of Excel for Mac (rev. 16.19). Because I need more room on the (laptop) screen to display results, I want to hide the ribbon when I open the workbook.



All solutions I've seen so far only work on Windows, not on Mac. I also tried Macscript to do it via Applescript (see below). This script works fine if I run it from scripteditor, but not embedded in VBA.



tell application "System Events" to tell process "Microsoft Excel"
set frontmost to true
keystroke "r" using {command down, option down}
end tell


In VBA it looks like this:



Sub example()
Dim toggleRibbon As String
toggleRibbon = "tell application ""System Events"" to tell process ""Microsoft Excel""" & vbNewLine & _
"set frontmost to true" & vbNewLine & _
"keystroke ""r"" using {command down, option down}" & vbNewLine & _
"end tell"
Debug.Print toggleRibbon 'to check format (use of double quotes, etc.)
MacScript (toggleRibbon)
End Sub


Executing this code gives an error 5 during runtime



Can anyone solve my issue?










share|improve this question
























  • Not very familiar with this stuff but your command is Applescript not VBA, so I guess VBA will not understand it. If you look for answers on here containing the word osascript you will see that you can run Applescript using osascript. Now, in VBA you can call Shell() so you should be able to do Shell(XXX) where XXX is either an osascript command or a bash script that contains the osascript command with the Applescript stuff you already have. Fairly similar example here stackoverflow.com/a/2198403/2836621
    – Mark Setchell
    Nov 20 at 11:08












  • In VBA for Mac you can run Applescript using the Macscript("string") command. The "string" must contain the Applescript (including the line breaks). That is what I already tried.
    – Frank Besseling
    Nov 20 at 11:19










  • Maybe click edit under your question and add that in if you tried it. It could be that you didn't escape the double quotes correctly - so add that into your question.
    – Mark Setchell
    Nov 20 at 11:28










  • Tnx Mark, I have embedded the VBA example I tried
    – Frank Besseling
    Nov 20 at 12:24
















0














I'm developing a VBA program on top of Excel for Mac (rev. 16.19). Because I need more room on the (laptop) screen to display results, I want to hide the ribbon when I open the workbook.



All solutions I've seen so far only work on Windows, not on Mac. I also tried Macscript to do it via Applescript (see below). This script works fine if I run it from scripteditor, but not embedded in VBA.



tell application "System Events" to tell process "Microsoft Excel"
set frontmost to true
keystroke "r" using {command down, option down}
end tell


In VBA it looks like this:



Sub example()
Dim toggleRibbon As String
toggleRibbon = "tell application ""System Events"" to tell process ""Microsoft Excel""" & vbNewLine & _
"set frontmost to true" & vbNewLine & _
"keystroke ""r"" using {command down, option down}" & vbNewLine & _
"end tell"
Debug.Print toggleRibbon 'to check format (use of double quotes, etc.)
MacScript (toggleRibbon)
End Sub


Executing this code gives an error 5 during runtime



Can anyone solve my issue?










share|improve this question
























  • Not very familiar with this stuff but your command is Applescript not VBA, so I guess VBA will not understand it. If you look for answers on here containing the word osascript you will see that you can run Applescript using osascript. Now, in VBA you can call Shell() so you should be able to do Shell(XXX) where XXX is either an osascript command or a bash script that contains the osascript command with the Applescript stuff you already have. Fairly similar example here stackoverflow.com/a/2198403/2836621
    – Mark Setchell
    Nov 20 at 11:08












  • In VBA for Mac you can run Applescript using the Macscript("string") command. The "string" must contain the Applescript (including the line breaks). That is what I already tried.
    – Frank Besseling
    Nov 20 at 11:19










  • Maybe click edit under your question and add that in if you tried it. It could be that you didn't escape the double quotes correctly - so add that into your question.
    – Mark Setchell
    Nov 20 at 11:28










  • Tnx Mark, I have embedded the VBA example I tried
    – Frank Besseling
    Nov 20 at 12:24














0












0








0







I'm developing a VBA program on top of Excel for Mac (rev. 16.19). Because I need more room on the (laptop) screen to display results, I want to hide the ribbon when I open the workbook.



All solutions I've seen so far only work on Windows, not on Mac. I also tried Macscript to do it via Applescript (see below). This script works fine if I run it from scripteditor, but not embedded in VBA.



tell application "System Events" to tell process "Microsoft Excel"
set frontmost to true
keystroke "r" using {command down, option down}
end tell


In VBA it looks like this:



Sub example()
Dim toggleRibbon As String
toggleRibbon = "tell application ""System Events"" to tell process ""Microsoft Excel""" & vbNewLine & _
"set frontmost to true" & vbNewLine & _
"keystroke ""r"" using {command down, option down}" & vbNewLine & _
"end tell"
Debug.Print toggleRibbon 'to check format (use of double quotes, etc.)
MacScript (toggleRibbon)
End Sub


Executing this code gives an error 5 during runtime



Can anyone solve my issue?










share|improve this question















I'm developing a VBA program on top of Excel for Mac (rev. 16.19). Because I need more room on the (laptop) screen to display results, I want to hide the ribbon when I open the workbook.



All solutions I've seen so far only work on Windows, not on Mac. I also tried Macscript to do it via Applescript (see below). This script works fine if I run it from scripteditor, but not embedded in VBA.



tell application "System Events" to tell process "Microsoft Excel"
set frontmost to true
keystroke "r" using {command down, option down}
end tell


In VBA it looks like this:



Sub example()
Dim toggleRibbon As String
toggleRibbon = "tell application ""System Events"" to tell process ""Microsoft Excel""" & vbNewLine & _
"set frontmost to true" & vbNewLine & _
"keystroke ""r"" using {command down, option down}" & vbNewLine & _
"end tell"
Debug.Print toggleRibbon 'to check format (use of double quotes, etc.)
MacScript (toggleRibbon)
End Sub


Executing this code gives an error 5 during runtime



Can anyone solve my issue?







excel vba macos applescript






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 at 19:39

























asked Nov 20 at 9:57









Frank Besseling

11




11












  • Not very familiar with this stuff but your command is Applescript not VBA, so I guess VBA will not understand it. If you look for answers on here containing the word osascript you will see that you can run Applescript using osascript. Now, in VBA you can call Shell() so you should be able to do Shell(XXX) where XXX is either an osascript command or a bash script that contains the osascript command with the Applescript stuff you already have. Fairly similar example here stackoverflow.com/a/2198403/2836621
    – Mark Setchell
    Nov 20 at 11:08












  • In VBA for Mac you can run Applescript using the Macscript("string") command. The "string" must contain the Applescript (including the line breaks). That is what I already tried.
    – Frank Besseling
    Nov 20 at 11:19










  • Maybe click edit under your question and add that in if you tried it. It could be that you didn't escape the double quotes correctly - so add that into your question.
    – Mark Setchell
    Nov 20 at 11:28










  • Tnx Mark, I have embedded the VBA example I tried
    – Frank Besseling
    Nov 20 at 12:24


















  • Not very familiar with this stuff but your command is Applescript not VBA, so I guess VBA will not understand it. If you look for answers on here containing the word osascript you will see that you can run Applescript using osascript. Now, in VBA you can call Shell() so you should be able to do Shell(XXX) where XXX is either an osascript command or a bash script that contains the osascript command with the Applescript stuff you already have. Fairly similar example here stackoverflow.com/a/2198403/2836621
    – Mark Setchell
    Nov 20 at 11:08












  • In VBA for Mac you can run Applescript using the Macscript("string") command. The "string" must contain the Applescript (including the line breaks). That is what I already tried.
    – Frank Besseling
    Nov 20 at 11:19










  • Maybe click edit under your question and add that in if you tried it. It could be that you didn't escape the double quotes correctly - so add that into your question.
    – Mark Setchell
    Nov 20 at 11:28










  • Tnx Mark, I have embedded the VBA example I tried
    – Frank Besseling
    Nov 20 at 12:24
















Not very familiar with this stuff but your command is Applescript not VBA, so I guess VBA will not understand it. If you look for answers on here containing the word osascript you will see that you can run Applescript using osascript. Now, in VBA you can call Shell() so you should be able to do Shell(XXX) where XXX is either an osascript command or a bash script that contains the osascript command with the Applescript stuff you already have. Fairly similar example here stackoverflow.com/a/2198403/2836621
– Mark Setchell
Nov 20 at 11:08






Not very familiar with this stuff but your command is Applescript not VBA, so I guess VBA will not understand it. If you look for answers on here containing the word osascript you will see that you can run Applescript using osascript. Now, in VBA you can call Shell() so you should be able to do Shell(XXX) where XXX is either an osascript command or a bash script that contains the osascript command with the Applescript stuff you already have. Fairly similar example here stackoverflow.com/a/2198403/2836621
– Mark Setchell
Nov 20 at 11:08














In VBA for Mac you can run Applescript using the Macscript("string") command. The "string" must contain the Applescript (including the line breaks). That is what I already tried.
– Frank Besseling
Nov 20 at 11:19




In VBA for Mac you can run Applescript using the Macscript("string") command. The "string" must contain the Applescript (including the line breaks). That is what I already tried.
– Frank Besseling
Nov 20 at 11:19












Maybe click edit under your question and add that in if you tried it. It could be that you didn't escape the double quotes correctly - so add that into your question.
– Mark Setchell
Nov 20 at 11:28




Maybe click edit under your question and add that in if you tried it. It could be that you didn't escape the double quotes correctly - so add that into your question.
– Mark Setchell
Nov 20 at 11:28












Tnx Mark, I have embedded the VBA example I tried
– Frank Besseling
Nov 20 at 12:24




Tnx Mark, I have embedded the VBA example I tried
– Frank Besseling
Nov 20 at 12:24












2 Answers
2






active

oldest

votes


















0














According to Excel dictionary the command should be "show ribbon" or "ribbon expanded". However, trying to get these properties from application document, window, workbook, basic window,...always return "missing value". I guess it is not properly handle by Microsoft for Applescript.



So work around, one more time, is to simulate user action. Script bellow simulates the click of the item 4 (="Ribbon") of the menu 5 ("View") of the main menu bar. Of course Excel must be activate (front most) before that simulation :



tell application "Microsoft Excel" to activate
tell application "System Events" to tell process "Microsoft Excel" to click menu item 4 of menu 5 of menu bar 1


This script is a flip/flop : if ribbon is visible for the window, it becomes hidden. If ribbon is hidden, it becomes visible.



Instead of flip/flop, if you want to check current value, you need to get the check mark of the menu (missing value or ✓)
This can be done via :



tell application "System Events" to tell process "Microsoft Excel" to set X to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"


X is true if ribbon is visible.



Tested on Excel 2011. Menu positions may be different on other Excel versions.






share|improve this answer































    0














    Thanks pbell, this is part of the solution. Issue is that this doesn't work on Office365 - see http://www.rondebruin.nl/mac/applescripttask.htm for that. When I applied that, the flip/flop works.
    It also introduced another issue, regarding your suggestion to check the current status. I wrote a handler for that:
    on checkRibbonStatus()
    set start_time to (current date)
    tell application "System Events" to tell process "Microsoft Excel"
    activate
    set ribbonCurrentlyVisible to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"
    end tell
    set end_time to (current date)
    return secondsToTimeString(end_time - start_time) -- test only; final version will return ribbonCurrentlyVisible
    end checkRibbonStatus



    on secondsToTimeString(t)
    -- reference: MacScripter.net : Nigel Garvey : https://macscripter.net/viewtopic.php?id=34653
    -- set d to t div days
    -- set t to t mod days
    tell (1000000 + (t div hours) * 10000 + (t mod hours div minutes) * 100 + t mod minutes) as text
    set TimeString to (text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7)
    end tell
    return TimeString as text
    end secondsToTimeString


    When I run this directly from AppleScript, it executes immediately. Embedded in VBA (see below) it takes 45 seconds to run!
    Sub ribbonAan()
    Dim ribbonStatus As String
    ribbonStatus = AppleScriptTask("ribbonStatus.scpt", "checkRibbonStatus", "")
    Range("Status").Value = ribbonStatus
    End Sub



    Any idea how to resolve this?






    share|improve this answer





















      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53390404%2fexcel-for-mac-hide-ribbon%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      According to Excel dictionary the command should be "show ribbon" or "ribbon expanded". However, trying to get these properties from application document, window, workbook, basic window,...always return "missing value". I guess it is not properly handle by Microsoft for Applescript.



      So work around, one more time, is to simulate user action. Script bellow simulates the click of the item 4 (="Ribbon") of the menu 5 ("View") of the main menu bar. Of course Excel must be activate (front most) before that simulation :



      tell application "Microsoft Excel" to activate
      tell application "System Events" to tell process "Microsoft Excel" to click menu item 4 of menu 5 of menu bar 1


      This script is a flip/flop : if ribbon is visible for the window, it becomes hidden. If ribbon is hidden, it becomes visible.



      Instead of flip/flop, if you want to check current value, you need to get the check mark of the menu (missing value or ✓)
      This can be done via :



      tell application "System Events" to tell process "Microsoft Excel" to set X to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"


      X is true if ribbon is visible.



      Tested on Excel 2011. Menu positions may be different on other Excel versions.






      share|improve this answer




























        0














        According to Excel dictionary the command should be "show ribbon" or "ribbon expanded". However, trying to get these properties from application document, window, workbook, basic window,...always return "missing value". I guess it is not properly handle by Microsoft for Applescript.



        So work around, one more time, is to simulate user action. Script bellow simulates the click of the item 4 (="Ribbon") of the menu 5 ("View") of the main menu bar. Of course Excel must be activate (front most) before that simulation :



        tell application "Microsoft Excel" to activate
        tell application "System Events" to tell process "Microsoft Excel" to click menu item 4 of menu 5 of menu bar 1


        This script is a flip/flop : if ribbon is visible for the window, it becomes hidden. If ribbon is hidden, it becomes visible.



        Instead of flip/flop, if you want to check current value, you need to get the check mark of the menu (missing value or ✓)
        This can be done via :



        tell application "System Events" to tell process "Microsoft Excel" to set X to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"


        X is true if ribbon is visible.



        Tested on Excel 2011. Menu positions may be different on other Excel versions.






        share|improve this answer


























          0












          0








          0






          According to Excel dictionary the command should be "show ribbon" or "ribbon expanded". However, trying to get these properties from application document, window, workbook, basic window,...always return "missing value". I guess it is not properly handle by Microsoft for Applescript.



          So work around, one more time, is to simulate user action. Script bellow simulates the click of the item 4 (="Ribbon") of the menu 5 ("View") of the main menu bar. Of course Excel must be activate (front most) before that simulation :



          tell application "Microsoft Excel" to activate
          tell application "System Events" to tell process "Microsoft Excel" to click menu item 4 of menu 5 of menu bar 1


          This script is a flip/flop : if ribbon is visible for the window, it becomes hidden. If ribbon is hidden, it becomes visible.



          Instead of flip/flop, if you want to check current value, you need to get the check mark of the menu (missing value or ✓)
          This can be done via :



          tell application "System Events" to tell process "Microsoft Excel" to set X to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"


          X is true if ribbon is visible.



          Tested on Excel 2011. Menu positions may be different on other Excel versions.






          share|improve this answer














          According to Excel dictionary the command should be "show ribbon" or "ribbon expanded". However, trying to get these properties from application document, window, workbook, basic window,...always return "missing value". I guess it is not properly handle by Microsoft for Applescript.



          So work around, one more time, is to simulate user action. Script bellow simulates the click of the item 4 (="Ribbon") of the menu 5 ("View") of the main menu bar. Of course Excel must be activate (front most) before that simulation :



          tell application "Microsoft Excel" to activate
          tell application "System Events" to tell process "Microsoft Excel" to click menu item 4 of menu 5 of menu bar 1


          This script is a flip/flop : if ribbon is visible for the window, it becomes hidden. If ribbon is hidden, it becomes visible.



          Instead of flip/flop, if you want to check current value, you need to get the check mark of the menu (missing value or ✓)
          This can be done via :



          tell application "System Events" to tell process "Microsoft Excel" to set X to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"


          X is true if ribbon is visible.



          Tested on Excel 2011. Menu positions may be different on other Excel versions.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 20 at 20:12

























          answered Nov 20 at 19:55









          pbell

          1,9281810




          1,9281810

























              0














              Thanks pbell, this is part of the solution. Issue is that this doesn't work on Office365 - see http://www.rondebruin.nl/mac/applescripttask.htm for that. When I applied that, the flip/flop works.
              It also introduced another issue, regarding your suggestion to check the current status. I wrote a handler for that:
              on checkRibbonStatus()
              set start_time to (current date)
              tell application "System Events" to tell process "Microsoft Excel"
              activate
              set ribbonCurrentlyVisible to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"
              end tell
              set end_time to (current date)
              return secondsToTimeString(end_time - start_time) -- test only; final version will return ribbonCurrentlyVisible
              end checkRibbonStatus



              on secondsToTimeString(t)
              -- reference: MacScripter.net : Nigel Garvey : https://macscripter.net/viewtopic.php?id=34653
              -- set d to t div days
              -- set t to t mod days
              tell (1000000 + (t div hours) * 10000 + (t mod hours div minutes) * 100 + t mod minutes) as text
              set TimeString to (text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7)
              end tell
              return TimeString as text
              end secondsToTimeString


              When I run this directly from AppleScript, it executes immediately. Embedded in VBA (see below) it takes 45 seconds to run!
              Sub ribbonAan()
              Dim ribbonStatus As String
              ribbonStatus = AppleScriptTask("ribbonStatus.scpt", "checkRibbonStatus", "")
              Range("Status").Value = ribbonStatus
              End Sub



              Any idea how to resolve this?






              share|improve this answer


























                0














                Thanks pbell, this is part of the solution. Issue is that this doesn't work on Office365 - see http://www.rondebruin.nl/mac/applescripttask.htm for that. When I applied that, the flip/flop works.
                It also introduced another issue, regarding your suggestion to check the current status. I wrote a handler for that:
                on checkRibbonStatus()
                set start_time to (current date)
                tell application "System Events" to tell process "Microsoft Excel"
                activate
                set ribbonCurrentlyVisible to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"
                end tell
                set end_time to (current date)
                return secondsToTimeString(end_time - start_time) -- test only; final version will return ribbonCurrentlyVisible
                end checkRibbonStatus



                on secondsToTimeString(t)
                -- reference: MacScripter.net : Nigel Garvey : https://macscripter.net/viewtopic.php?id=34653
                -- set d to t div days
                -- set t to t mod days
                tell (1000000 + (t div hours) * 10000 + (t mod hours div minutes) * 100 + t mod minutes) as text
                set TimeString to (text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7)
                end tell
                return TimeString as text
                end secondsToTimeString


                When I run this directly from AppleScript, it executes immediately. Embedded in VBA (see below) it takes 45 seconds to run!
                Sub ribbonAan()
                Dim ribbonStatus As String
                ribbonStatus = AppleScriptTask("ribbonStatus.scpt", "checkRibbonStatus", "")
                Range("Status").Value = ribbonStatus
                End Sub



                Any idea how to resolve this?






                share|improve this answer
























                  0












                  0








                  0






                  Thanks pbell, this is part of the solution. Issue is that this doesn't work on Office365 - see http://www.rondebruin.nl/mac/applescripttask.htm for that. When I applied that, the flip/flop works.
                  It also introduced another issue, regarding your suggestion to check the current status. I wrote a handler for that:
                  on checkRibbonStatus()
                  set start_time to (current date)
                  tell application "System Events" to tell process "Microsoft Excel"
                  activate
                  set ribbonCurrentlyVisible to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"
                  end tell
                  set end_time to (current date)
                  return secondsToTimeString(end_time - start_time) -- test only; final version will return ribbonCurrentlyVisible
                  end checkRibbonStatus



                  on secondsToTimeString(t)
                  -- reference: MacScripter.net : Nigel Garvey : https://macscripter.net/viewtopic.php?id=34653
                  -- set d to t div days
                  -- set t to t mod days
                  tell (1000000 + (t div hours) * 10000 + (t mod hours div minutes) * 100 + t mod minutes) as text
                  set TimeString to (text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7)
                  end tell
                  return TimeString as text
                  end secondsToTimeString


                  When I run this directly from AppleScript, it executes immediately. Embedded in VBA (see below) it takes 45 seconds to run!
                  Sub ribbonAan()
                  Dim ribbonStatus As String
                  ribbonStatus = AppleScriptTask("ribbonStatus.scpt", "checkRibbonStatus", "")
                  Range("Status").Value = ribbonStatus
                  End Sub



                  Any idea how to resolve this?






                  share|improve this answer












                  Thanks pbell, this is part of the solution. Issue is that this doesn't work on Office365 - see http://www.rondebruin.nl/mac/applescripttask.htm for that. When I applied that, the flip/flop works.
                  It also introduced another issue, regarding your suggestion to check the current status. I wrote a handler for that:
                  on checkRibbonStatus()
                  set start_time to (current date)
                  tell application "System Events" to tell process "Microsoft Excel"
                  activate
                  set ribbonCurrentlyVisible to (value of attribute "AXMenuItemMarkChar" of menu item 4 of menu 5 of menu bar 1) is "✓"
                  end tell
                  set end_time to (current date)
                  return secondsToTimeString(end_time - start_time) -- test only; final version will return ribbonCurrentlyVisible
                  end checkRibbonStatus



                  on secondsToTimeString(t)
                  -- reference: MacScripter.net : Nigel Garvey : https://macscripter.net/viewtopic.php?id=34653
                  -- set d to t div days
                  -- set t to t mod days
                  tell (1000000 + (t div hours) * 10000 + (t mod hours div minutes) * 100 + t mod minutes) as text
                  set TimeString to (text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7)
                  end tell
                  return TimeString as text
                  end secondsToTimeString


                  When I run this directly from AppleScript, it executes immediately. Embedded in VBA (see below) it takes 45 seconds to run!
                  Sub ribbonAan()
                  Dim ribbonStatus As String
                  ribbonStatus = AppleScriptTask("ribbonStatus.scpt", "checkRibbonStatus", "")
                  Range("Status").Value = ribbonStatus
                  End Sub



                  Any idea how to resolve this?







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 22 at 9:17









                  Frank Besseling

                  11




                  11






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53390404%2fexcel-for-mac-hide-ribbon%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Create new schema in PostgreSQL using DBeaver

                      Deepest pit of an array with Javascript: test on Codility

                      Costa Masnaga