Accessing Excel from the Script :
'This script creates an Excel file and writes data to sequential rows.
Imports System 'Importing necessary classes.
Imports System.IO
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Namespace WinTr
Public Class MainClass
Public Sub Load 'Load procedure is defining.
'Script starts working within this procedure.
'WinTr tags should be accessed from this procedure.
'When this procedure finished working
'WinTr tags can not be reached anymore from this script.
'------- Script Start Line -------
'Excel application object is defining.
Dim Ex As Microsoft.Office.Interop.Excel.Application
Dim i As Integer
'New Excel application is creating within the object.
Ex = New Microsoft.Office.Interop.Excel.Application
Ex.Workbooks.Add() 'Excel workbook is being created.
Ex.Worksheets(1).cells(1, 1).value = "No"'Excel cells is being written.
Ex.Worksheets(1).cells(1, 2).value = "Date"
Ex.Worksheets(1).cells(1, 3).value = "Level"
For i = 0 To 10 ' for loop is created.
'values are written to sequental Excel rows.
Ex.Worksheets(1).cells(i + 2, 1).value = i
Ex.Worksheets(1).cells(i + 2, 2).value = i+1
Ex.Worksheets(1).cells(i + 2, 3).value = i+2
Next
Ex.Visible = True
'------- Script End Line -------
End Sub
End Class
End Namespace