PDA

View Full Version : Error when using Excel module



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

ErosOlmi
20-04-2018, 14:10
Ciao Adam,

that message box is a debug message box left in the Excel module for an error.
What version of thinBasic are you using?

I think 1.9.16.17
If so, please download thinBasic 1.10.x from here: http://www.thinbasic.com/community/showthread.php?12778

Let me know
Eros

AdamCounsell
20-04-2018, 16:40
Hi Eros,

I am using version 1.10.4.0 (sorry meant to put that in my original post).

9846


Adam

ErosOlmi
20-04-2018, 17:05
Thanks.
I will check this evening when back from work.

ErosOlmi
20-04-2018, 20:46
Can you please download attached thinBasic_Excel.dll module and put it into your \thinBasic\Lib\ path replacing your current one?

Let me know if it fixes the problem.

Ciao
Eros

AdamCounsell
21-04-2018, 13:02
Hi Eros,

Yes that seems to have fixed the issue. The sample Excel script now runs successfully.

I'll have more of a bash next week and let you know if there are any other issues.


Thanks

Adam