Set in EXCEL

Copies information to EXCEL sheet from a Simul8 Global data item. This would normally be a spreadsheet, but it can also be a Global variable. If the Global data item is a spreadsheet location, then Width and Height can be used to copy an area of a spreadsheet from Simul8 to EXCEL.

Parameters

  • Simul8 Data - Single Global Data Item or Spreadsheet location. If information is copied from a Spreadsheet, the cell reference, after the spreadsheet’s name, tells Simul8 what cell to start copying the information from. For example, if you wish to copy your data starting from the leftmost, top cell of your internal spreadsheet you should use column 1 and row 1 (e.g. ssResults[1,1]).
  • EXCEL Sheet: The name should be 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 to the EXCEL Sheet.

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

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

  • Columns - Number of columns (width) of area to copy (1 for single data item)
  • Rows - Number of rows (height) of area to copy (1 for single data item)

Comments

  • Use at the end of a run (during ENDRUN logic) to copy relevant results information to EXCEL. If the EXCEL Sheet name braces contain no file name (e.g. []Sheet1) then the file name from the Excel Extension dialog is automatically used.
  • EXCEL needs to be open for data to be copied
  • 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

The following example copies all data after the top left cell of the ssResults internal spreadsheet, to Sheet 1 of the Results.xlsx EXCEL file. It places the data on the 3rd column and the first row of Sheet 1. It copies 3 columns and 100 rows from ssResults.

The second example copies the value of the gbl_Production Volume global variable to the 3rd column and the first row of Sheet 1 in the Results.xlsx EXCEL file. Since it’s a global variable, Weight and Height don’t apply, thus 1 is used for the last two parameters.

See Also