Get from EXCEL

Copies information from an EXCEL sheet into a Global data item in SIMUL8. This would normally be an internal spreadsheet, but it can also be a Global Variable. If the Global data Item is an spreadsheet, then Width (number of columns) and Height (number of rows) can be used to copy an area of a spreadsheet from EXCEL to SIMUL8.

Parameters

  • SIMUL8 Global Data Item - Single Global Data Item or Spreadsheet. If information is copied to a Spreadsheet, the cell reference, after the spreadsheet’s name, tells SIMUL8 what cell to start writing the information in. For example, if you wish to copy your data on the leftmost, top cell of your internal spreadsheet you should use column 1 and row 1 (e.g. ssExcelData[1,1]).
  • EXCEL Sheet - EXCEL Sheet name in this format: “[file.xlsx]Sheet Name”. Other file formats can also be used, such as .xls. This parameter should be placed within quotation marks.

The next two parameters define the area, onwards from which, information is copied from the EXCEL sheet.

  • EXCEL Cell (Column Number) - Defines the column onwards from which information is copied.
  • EXCEL Cell (Row Number) – Defines the row onwards from which information is copied.

The last two parameters define the area of the Excel Sheet to be copied to the Spreadsheet.

  • Width: The number of columns to be copied (1 for single data item)
  • Height: The number of rows to be copied (1 for single data item)

Comments

  • Use when resetting SIMUL8 (during on Reset Logic) or when clicking a Button (Button Click Logic) to copy in relevant information for each run. Attempting to read information in from Excel during a run pauses the simulation until import is finished and could thus, slow down the simulation.
  • When using the command in SIMUL8 Online the EXCEL file should be uploaded to the Online Account.
  • Only an xlsx. File format can be imported in SIMUL8 Online.
  • Cell referencing codes between the EXCEL Sheet and the Spreadsheet in SIMUL8 should match for information to be copied from EXCEL to SIMUL8. The default referencing code used in SIMUL8 is R1C1, but you can set the code of your choice by clicking on File> Preferences> Options> Row/Column Referencing codes.

Annotated Example

Related Commands

See Also