Using excel VBA with K8055

First time use help required.

If I use the following code from the Velleman site in Excel VBA - I am unable to connect to card - I receive an error “Sub Function not defined” highlighting - Check(0).

Can the VB header and code below be used in VBA?

Are there any simple examples of Excel VBA code (including hearers) available? I wish to read into excel - do some calculations the output from excel.

Private Declare Function ReadAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long) As Long
Private Declare Sub ReadAIIAnalog Lib "k8055d.dll" (Datal As Long, Data2 As Long)
Private Declare Sub OutputAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long, ByVal Data As Long)
Private Declare Sub OutputAIIAnalog Lib "k8055d.dll" (ByVal Datal As Long, ByVal Data2 As Long)
Private Declare Sub ClearAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub SetAllAnalog Lib "k8055d.dll" ()
Private Declare Sub ClearAllAnalog Lib "k8055d.dll" ()
Private Declare Sub SetAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub WriteAllDigital Lib "k8055d.dll" (ByVal Data As Long)
Private Declare Sub ClearDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub ClearAllDigital Lib "k8055d.dll" ()
Private Declare Sub SetDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub SetAllDigital Lib "k8055d.dll" ()
Private Declare Function ReadDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long) As Boolean
Private Declare Function ReadAllDigital Lib "k8055d.dll" () As Long
Private Declare Function ReadCounter Lib "k8055d.dll" (ByVal CounterNr As Long) As Long
Private Declare Sub ResetCounter Lib "k8055d.dll" (ByVal CounterNr As Long)
Private Declare Sub SetCounterDebounceTime Lib "k8055d.dll" (ByVal CounterNr As Long, ByVal DebounceTime As Long)
 
Private Sub Connect_Click()
    Dim CardAddress As Long
    Dim h As Long
    CardAddress = 0
    CardAddress = 3 - (Check(0).Value + Check1(1).Value * 2)
    h = OpenDevice(CardAddress)
    Select Case h
    Case 0, 1, 2, 3
    Labell.Caption "Card" + Str(h) + " connected"
    Case -1
    Labell.Caption "Card" + Str(CardAddress) + " not found"
    End Select
End Sub

Private Sub Form_Terminate()
    CloseDevice
End Sub

:ADMIN: Changed the topic title from K5088 to K8055 and added code tags

[quote]I receive an error “Sub Function not defined” highlighting - Check(0).[/quote]It seems that you do not have the checkbox on the Excel sheet or there is something else wrong with the checkbox definition.

Here’s the link to download the K8055 software package with examples and with new K8055D.DLL: velleman.eu/downloads/files/ … rsion4.zip
Please see the example in the subfolder \examples\K8055DemoExcel

Before running the example, please copy the file K8055D.DLL from the folder \DLL_v4.0.0.0 to the \Windows\System32 folder.
In 64-bit environment copy the file to \Windows\SysWOW64 folder

Thanks for the reply - all working and happy !

Well nearly, I downloaded the iphone app to have remote control to the board - although it does not work and there are very few indications of what to look at and for.
Any useful places to check?