You can control Excel and run Excel macros from within Aurora Scripting. The following is a sample script that runs an Excel macro. The Import statements “Imports Microsoft.Office.Interop” and “Imports Microsoft.VisualBasic” must be included in the script to create an Excel application object.
Imports System
Imports Microsoft.VisualBasic
Imports AURORAServer
Imports AuroraServer.Options
Imports EnergyExemplar.Aurora.ParameterSets.Parameters
Imports Microsoft.Office.Interop
Class AuroraScript
Shared AC As ComApplication = VB_RemoteAPI.InitializeAC()
Shared ADS As ComDataSet = VB_RemoteAPI.InitializeADS()
Shared Sub Main()
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.WorkSheet
xlApp = CreateObject("Excel.Application")
xlBook = xlApp.Workbooks.Add
xlSheet = xlBook.Worksheets(1)
End Sub
End Class
Aurora can be controlled from Excel (and other applications) using VBA, as well as VB .Net. Refer to Scripting Aurora from Microsoft Excel for specific commands and instructions.
Scripting