ExcelApp Property

 

The Simulator Automation Server has the ability to send data from Simulator to an Excel spreadsheet using the SendToExcel. By default, the Simulator Automation Server starts an instance of Excel the first time one of the above functions is called. Each subsequent call to these two functions will then send data to the same instance of Excel, until it is manually closed by the user. The ExcelApp property allows the user to gain access to the instance of Excel used by the Simulator Automation Server from within its own code. Thus the user can write code to manipulate the external instance of Excel. In addition, the ExcelApp property can be set by the user’s code, meaning that the user can initialize an external instance of Excel from within their own code and set the ExcelApp property to their external instance of Excel. Simulator itself is limited to starting only one instance of Excel on its own, but with the ExcelApp property allowing you to set the instance of Excel that Simulator uses on the fly, you can generate multiple instances of Excel within your code, and handle setting the ExcelApp property of the Simulator Automation server to the desired Excel instance depending on the data you want to send to Excel.

The ExcelApp property is a variable of type Variant that returns the pointer to an object representing the external instance of Excel.

ExcelApp : Variant

To gain access to the external instance of Excel stored in the ExcelApp property, you first need to initialize a variable as an object. The following are a couple of examples in Borland Delphi and Microsoft Visual Basic.

 

Examples

Borland Delphi 5

Microsoft Visual Basic