SendToExcel Function
The SendToExcel function can be called to send data from the Simulator Automation Server to an Excel spreadsheet. The function is flexible in that you can specify the type of object data you want to export, an advanced filter name for a filter you want to use, and as many or as few field types as desired that are supported by the type of object. The first time this function is called, a new instance of Excel will be started, and the data requested will be pasted to a new sheet. For each subsequent call of this function, the requested data will be pasted to a new sheet within the same workbook, until the workbook is closed.
Function Prototype
SendToExcel(ObjectType, FilterName, FieldList)
Parameter Definitions
ObjectType : String A string describing the type of object for which you are requesting data.
FilterName : String The name of an advanced filter which was previously defined in the case before being loaded in the Simulator Automation Server. If no filter is desired, then simply pass an empty string. If a filter name is passed but the filter cannot be found in the loaded case, no filter is used.
FieldList : Variant This parameter must either be an array of fields for the given object or the string "ALL". As an array, FieldList contains an array of strings, where each string represents an object field variable, as defined in the section on PowerWorld Object Variables. If, instead of an array of strings, the single string "ALL" is passed, the Simulator Automation Server will use predefined default fields when exporting the data.
Output
SendToExcel returns only one element in Output—any errors which may have occurred when attempting to execute the function.