SendToExcel Function: Sample Code
Microsoft® Visual Basic for Applications
Dim FieldList As Variant
' Setup fieldlist to send the bus number, gen id and gen agc to Excel
FieldList = Array("BusNum", "GenID", "GenAGCAble")
' Make the SendToExcel call
' By specifying the parameter FieldList, only the three fields
' for each generator will be returned
Output = SimAuto.SendToExcel("gen", "", "FieldList")
' Sending the string "all" instead of a fieldlist array
' writes all predefined fields to the Excel spreadsheet
Output = SimAuto.SendToExcel("gen", "", "all")
Note: This function call will send the values of the fields in FieldList to an Excel workbook for all the generators in the load flow case. If a filter name had been passed instead of an empty string, Simulator would have located and used a pre-defined advanced filter and applied it to the information if it was found.
Matlab®
% Setup fieldlist to send the bus number, gen id and gen agc to Excel
fieldlist = {'BusNum' 'GenID' 'GenAGCAble' };
% Make the SendToExcel call
Output = SimAuto.SendToExcel('gen', '' , FieldList);
% Sending the string 'all' instead of a fieldlist array
% writes all predefined fields to the Excel spreadsheet
Output = SimAuto.SendToExcel('gen', '', 'all');
Note: This function call will send the values of the fields in FieldList to an Excel workbook for all the generators in the load flow case. If a filter name had been passed instead of an empty string, Simulator would have located and used a pre-defined advanced filter and applied it to the information if it was found.