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.
  • In Simul8 Online, only an xlsx. file format can be imported.
  • In Simul8 Online, make sure that the Excel file's name doesn't include spaces.
  • 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

You can find the simulation file of this example here: Get_from_EXCEL.s8

See Also