Excel Import to Rhinoscript

Example Rhinoscript to import excel files into variables.

Option Explicit
'excel import to rhinoscript , che-wei wang 4.8.2008
'excel cell numbers begin with 1,1 (not 0,0)

Call Main()
Sub Main()
	Dim FileName, file, excel
	FileName = Rhino.OpenFileName("Select Excel File","Excel Files (*.xls)|*.xls||")
	If isNull(FileName) Then Exit Sub

	Set excel = CreateObject("Excel.Application")
	excel.Visible = True

	excel.Workbooks.Open(FileName)
	Set file = excel.ActiveSheet

	Dim x:x= file.Cells(1,2).Value

	Call Rhino.Print(x)

	excel.UserControl = True
End Sub