Visual Basic Program

When running the following program provided by velleman to interface with Excel the whole program (Excel and basic) closes when it executes the ReadCh1 DataBuffer1(0).

Option Explicit
Dim DataBuffer1(0 To 5000) As Long
Dim DataBuffer2(0 To 5000) As Long
Declare Sub ReadCh1 Lib "DSOLink.dll " (Buffer As Long)
Declare Sub ReadCh2 Lib "DSOLink.dll " (Buffer As Long)

Sub ReadAll()
Dim i As Long
ReadCh1 DataBuffer1(0)
ReadCh2 DataBuffer2(0)
With ActiveSheet
For i = 0 To 99
.Cells(i + 1, 2) = DataBuffer1(i)
.Cells(i + 1, 3) = DataBuffer2(i)
Next i
End With
End Sub

Please can you help.

What is your operation system?
Do you have the file DSOLink.dll in the Windows folder SYSTEM32 ?

You may try adding “On Error Resume Next” somewhere:

Option Explicit
Dim DataBuffer1(0 To 5000) As Long
Dim DataBuffer2(0 To 5000) As Long
Declare Sub ReadCh1 Lib "DSOLink.dll " (Buffer As Long)
Declare Sub ReadCh2 Lib "DSOLink.dll " (Buffer As Long)

Sub ReadAll()
Dim i As Long
[color=blue]On Error Resume Next[/color]
ReadCh1 DataBuffer1(0)
ReadCh2 DataBuffer2(0)
With ActiveSheet
For i = 0 To 99
.Cells(i + 1, 2) = DataBuffer1(i)
.Cells(i + 1, 3) = DataBuffer2(i)
Next i
End With
End Sub

I cannot find the DSOLink.dll in the System 32 folder though I have PCLab 2000 installed in my system. I searched the computer and I couldn’t find it. Could you tell me where I could download the dll?
My OS is WindowsXP.

I could not find the DLL in the setup CD.

The DSOLink.DLL should be both in the C:\Program Files\Velleman\PC-Lab2000SE and in SYSTEM32 folder.

Have you downloaded and installed the latest v3.05 of the PCLab2000SE ?

velleman.be/downloads/files/ … e_3_05.zip