Search notes:

Test for function showRibbon of the VBA module ExcelHelpers

This is a simple test for the showRibbon function of the ExcelHelpers VBA module.
option explicit

sub main() ' {

    createButton range(cells(2,2), cells(3,4)), "Show Ribbon", "show_ribbon"
    createButton range(cells(5,2), cells(6,4)), "Hide Ribbon", "hide_ribbon"

end sub ' }

sub show_ribbon() ' {
    showRibbon true
end sub ' }

sub hide_ribbon() ' {
    showRibbon false
end sub ' }
Github repository VBAModules, path: /_test/Office/xls-showRibbon.vb

xls-showRibbon.wsf

xls-showRibbon.wsf is the VBS script to be used together with the VBScript MS-Office App Creator in order to create a workbook that demonstrates showRibbon. It must be invoked on the command line like so
cscript.exe xls-showRibbon.wsf
<job>
<script language="VBScript" src="../VBS-MS-Office-App-Creator/create-MS-Office-app.vbs" />
<script language="VBScript">

   option explicit

   dim app
   dim xls
   set xls = createOfficeApp("excel", currentDir() & "created.xlsm")
   if xls is nothing then ' {
      wscript.echo "Could not create excel worksheet."
      wscript.quit -1
   end if ' }

   set app = xls.application

   insertModule app, currentDir() & "../../Office/ExcelHelpers.vb" , "ExcelHelpers" , 1
   insertModule app, currentDir() & "xls-showRibbon.vb"            , "func"         , 1

   app.run "main"

   xls.save

   wscript.echo "The end"
   createObject("WScript.Shell").appActivate(app.caption)

</script> </job>
Github repository VBAModules, path: /_test/Office/xls-showRibbon.wsf

See also

VBA Module ExcelHelpers [Excel]

Index