AdamCounsell
20-04-2018, 12:02
Hi,
I have been attempting to use the Excel module in ThinBasic but it is throwing a strange error message.
The small program below was written to test the Excel connection.
Uses "Excel"
Uses "Console"
Uses "File"
Dim sXlsFileName As String
Dim xApp As EXCEL_APPLICATION '---This will instantiate the real Excel Application
Dim xWorkBook As EXCEL_WORKBOOK '---An object representing an Excel Workbook (an excel file)
Dim xSheet As EXCEL_WORKSHEET '---An object representing a single Excel worksheet
Dim xRange As EXCEL_RANGE '---An object representing a Range. Will be used to point to different ranges when needed
Dim Filename As String = "c:\ifiles\AVLABL Messages_Apr10.xlsx"
Dim x, y As Long
xApp = New EXCEL_APPLICATION
xApp.Visible = %TRUE
xWorkBook = xApp.WorkBooks.Open(FileName, 2, %FALSE, 5, "")
PrintL "Hello"
xapp.quit
When this is run the pop-up below appears.
9843
I click on OK and then I get the error message below.
9844
The line it is complaining about is blank (below).
9845
I also tried running the sample program Excel_Test.tbasic - this also throws the same error at line 21 after the xApp.Visible = %TRUE command.
Has anyone come across this before?
Thanks
Adam Counsell
I have been attempting to use the Excel module in ThinBasic but it is throwing a strange error message.
The small program below was written to test the Excel connection.
Uses "Excel"
Uses "Console"
Uses "File"
Dim sXlsFileName As String
Dim xApp As EXCEL_APPLICATION '---This will instantiate the real Excel Application
Dim xWorkBook As EXCEL_WORKBOOK '---An object representing an Excel Workbook (an excel file)
Dim xSheet As EXCEL_WORKSHEET '---An object representing a single Excel worksheet
Dim xRange As EXCEL_RANGE '---An object representing a Range. Will be used to point to different ranges when needed
Dim Filename As String = "c:\ifiles\AVLABL Messages_Apr10.xlsx"
Dim x, y As Long
xApp = New EXCEL_APPLICATION
xApp.Visible = %TRUE
xWorkBook = xApp.WorkBooks.Open(FileName, 2, %FALSE, 5, "")
PrintL "Hello"
xapp.quit
When this is run the pop-up below appears.
9843
I click on OK and then I get the error message below.
9844
The line it is complaining about is blank (below).
9845
I also tried running the sample program Excel_Test.tbasic - this also throws the same error at line 21 after the xApp.Visible = %TRUE command.
Has anyone come across this before?
Thanks
Adam Counsell