Spreadsheet Basic (spBasic) - Menus
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


The SpBasic Menu
   Main spBasic Menu
   Edit Form Buttons
        New Program Button
        Save Program Button
        Save Program and Workbook Button
        Cut, Copy, Paste, Delete, Undo, Redo
        Find Button

       Statement Help Button
      
Help Form Button
       Debug Button
       Run/Stop Button
  Edit Form Menu Items
      File Menu
      View Menu
      Run/Debug Menu
      Tools Menu
      Help Menu
  Other Edit Form Items
      'On Top' Checkbox
      Workbook, Worksheet, Program Dropdown Lists
      Statement Argument Help Window

 


Main spBasic Menu
The spBasic menu is available after you install spBasic as an Excel Add-In. The menu appears as part of the Excel main menu, or as part of the Excel Popup menu which is displayed when you right-click a cell on an Excel worksheet.

                  

The menu items are,

  • Create, Edit, or Run spBasic Programs
       This selection displays the spBasic Edit Form where can create and debug programs.
  • Create a Chart
       This selection allows you to create a Chart worksheet or an Embedded Chart within a worksheet.  See the Excel Charts page for details on how to create Charts using this menu item.
  • Stop an spBasic Program
       This selection stops any spBasic program that is presently running.

The spBasic Edit Form

The Create, Edit, or Run spBasic Programs menu item displays the Edit Form shown above. This is used to create, debug, and run spBasic programs. See the "Hello World" program on the Language page for an example of how to run and debug a program.
Using Other Text Editors
You can use any text editor to write or edit spBasic programs. Simply select select the entire window by right-clicking on the window and choosing 'Select All', then click 'Copy'. The selected area will be copied as text, then you can paste it into your favorite text editor. When you're through, copy the program from your text editor, select the entire spBasic window content using 'Select All', then click 'Paste'.

     Edit Form Buttons


  New Program
Button

The leftmost button is the New Program button, use this to create new spBasic programs.

              

This is the same as the "File->New Program" menu selection. When creating a new program, you must enter a program name using the Program Name form, and the program name cannot contain spaces. See the Language page to get more info on programs and to view a "Hello World" program.


  Save Program
Button

The second leftmost button is the Save Program button, use this to save spBasic programs.

      

                                

This is the same as the "File->Save Program" menu selection and the "Save Program" right-click menu selection in the edit window.

  Save Program and Workbook
Button

The third leftmost button is the Save Program and Workbook button, use this to save both the spBasic programs and the program workbook.

      

                    

This is the same as the "File->Save Program and Workbook " menu selection and the "Save Program and Workbook " right-click menu selection in the edit window.

  Cut, Copy, Paste, Delete, Undo, and Redo
Edit Buttons

The next six buttons are the program edit buttons, use these to edit the spBasic program in the program edit window.

        

    

These edit items are also displayed on the right-click menu selections in the edit window.

  Find
Button

The fifth button from the right is the Find button. This is used to find or replace text in the program edit window. When the Find button is clicked, the Find and Replace window is displayed. To find text, enter the text in the first textbox and press the "Find Next" button. To replace the text, click "Replace" and enter the replacement text in the second textbox, then click the "Replace" or "Replace All" button. You can always use the "Undo" and "Redo" buttons is you made any replacements by mistake.

        

                               


   Statement Help
Button

The forth button from the right is the Statement Help button.This displays statement help for the statement at the cursor position in the program edit window.  Statement Help is also available on the right-click menu item Show Statement Help in the progarm edit window.

                   

                                 

For example, if the cursor is at the 'clear' statement as shown above, and the Statement Help button is clicked, or the Help function key F1 is pressed, or the Show Statement Help right-click menu item is selected, Help for the 'Clear' statement shown below will be displayed.

                     


    Help Form
Button

The third button from the right is the Help Form button.This displays the spBasic "Help" Form. See the Help Form page for a description of this form.    

                  


   Debug
Button

The second button from the right is the Debug Program button. This displays the Debug buttons on the Edit form. See the Debug Form page for a description of the Debug mode.    

                  


   Run/Stop
Button

The first button from the right is the Run Program button. It is also used to Stop a program (the 'R' on the button changes to an 'S'). Clicking on this button runs or stops the spBasic program in the Edit Window. See the Language page to get more info on programs and to view a "Hello World" program.

                    

                         Stop ('S') a program when it is running


Edit Form Menu Items

      File Menu


     

                                    

  • Exit - This exits the spBasic Edit Form.


     View Menu


     

  • Refresh All Program - This menu item refreshes the displayed program, and also refreshes all programs in the dropdown program lists for all workbooks and worksheets.

  •      

   
       Run/Debug Menu

  • Run Program - This menu item runs the spBasic program in the Edit Window. See the Language page to get more info on programs and to view a "Hello World" program.
  • Debug Program - This displays the Debug buttons on the Edit form. See the Debug Form page for a description of the Debug mode.

   
     Tools Menu


     

  • Create Variable Column
       This menu item creates a variable column at the selected worksheet column. The first cell in the selected column is set to "// variables". SpBasic looks for the term "// var" in the first cell of a column to identify variable columns, then adds the terms in the column to the Excel 'Names' list. The column to the immediate right of the variable column is reserved for the variable value. The variables defined in a "// variables" column are local to the worksheet, not the entire workbook. Variables global to the entire workbook can be defined using the "Create Global Column" menu item.
    See the Language page to get more info on variable columns and to view a "Hello World" program.
  • Create Global Column
       This menu item creates a global variable column at the selected worksheet column. The first cell in the selected column is set to "// globals". SpBasic looks for the term "// glob" in the first cell of a column to identify global variable columns, then adds the terms in the column to the Excel 'Names' list. The column to the immediate right of the global variable column is reserved for the variable value. The variables defined in a "// globals" column are global to the entire workbook, not just the worksheet. Variables local to the worksheet can be defined using the "Create Variable Column" menu item.
       
  • Create Buttons
  •        

  •  Create Buttons - Run Button
        This selection creates a 'Run' button on the worksheet at the cursor position. The following form is displayed,

            

    Click OK and a button will be created at the Excel cursor position. Clicking the button will run the program.
          
  • Create Buttons - Stop Button
       This selection creates a 'Stop' button on the worksheet at the cursor position. When you click the 'Stop' button, any spBasic program that is running will be stopped.
       
  • Create Buttons - Create Both Buttons
       This selection creates both a Run and a Stop button as described above.
       
  • Create Custom Code
    This menu item allows you to create your own spbasic Statements in an Excel Add-In created from a standard text file. The following form is displayed,

           
      
    See the Custom Code page for info on how to write your own spBasic statements.
         
  • Program Protection - Protect Programs in Worksheet



    This menu item allows you to protect spBasic programs from being viewed or changed. Selecting this item displays the message,



    Answering 'Yes' will display the password form,

                                       

    Enter the password to protect the program, the program window will then look like,




  • Program Protection - UnProtect Programs in Worksheet



    This menu item allows you to unprotect spBasic programs that had been previously protected. Selecting this item displays the message,



    Answering 'Yes' will display the password form,

                                       

    Enter the password and the program will be unprotected and will display as normal.


    Help Menu



    Clicking the "Show Help Form" item on the Help menu will display the spBasic Help Form. See the Help Form page. The menu also shows the link to this web site.

    Other Edit Form Items


    'On Top' Checkbox

              

The "On Top" checkbox, if checked, keeps the spBasic Edit form on the top of other windows. This is useful when running a program and looking at a spreadsheet to see the program results. If this box is checked, clicking on the spreadsheet won't hide the Edit Form window. You want to be careful with this option if you write a Excel VBA program that uses a message box and run the VBA program from spBasic.  If the VBA program displays a msgbox, and a spBasic window is showing (Edit Form. Help, etc.) , the msgbox might appear behind the spBase window and cannot be accessed with the mouse. If this happens, press ‘Enter’ to terminate the msgbox and return control to the spBasic form. This can be avoided by moving the spBasic window to the side, or minimize the Edit form and create a Run button to run the spBasic program (run the program from the ‘Run’ button).

         Workbook, Worksheet, and spBasic Program Dropdown Lists

              

The Workbook, Worksheet, and Program Dropdown Lists allow you to select any program in any of the Excel open workbooks. Clicking the 'Workbook" list allows you to select any open workbook and displays the Worksheets and Programs in the selected Workbook. The "Worksheet" list allows you to select any worksheet in the selected workbook, and the "Program" listbox lets you select a program in the selected worksheet. These lists are used to navigate and select the spBasic programs for viewing or editing.

        Statement Argument Help Window

              

The Statement Argument Help window appears immediately below the Workbook, Worksheet, and Program dropdown lists. This window displays an spBasic Statement with Arguments.The statement it displays is the statement below the cursor in the edit window. For the example shown above, the cursor in the Edit window is at the 'Clear' statement. The 'Clear' statement showing the arguments for the statement appears in the Argument Help window. This window shows both the number and order of arguments for the statement, and is useful when writing a statement when you are not sure of the statement structure.

 


 Live Excel Help!

Free initial talk time, no charge until you're convinced that the expert can help you!



Search for Expert Advice!

Ask an Expert a Question!



   Copyright © 2007,  Reportdata.com, LLC                                                                                                        Contact Us