I’m a newbie here. I have programed some lines in VB2008 to manage my VM8090 relay card and it works superb, but now I need to write some code in vba for EXCEL and don’t have any idea and haven’t found any examples on how to load or handle the K8090.dll into it.
Oh boy… the best thing you can do is go about it step by step, starting from tutorials on the internet. If you need to collect data, you could always consider just writing your data to a file from VB2008. Put it in some kind of text format that can be opened in Excel.
Sorry, I think I didn’t make myself clear. I don’t really need to collect data, what I need is write some code to manage the relay outputs depending on some parameters in Excel cells with vba/macros programing in the same workbook.
I’ve written code in Visual Basic 2008 but I don’t know how to call the K8090D.dll functions from vba. The only samples in the downloadable documentation are for Visual Basic.
Is there any known documentation anywhere with minimum examples for Excel programing?
I managed to make the functions OpenDevice, SendCommand and CloseDevice work in Excel vba code, and switch the relay outputs, but have no idea about how to capture events from the card.
I’m not sure, but that may not be possible… The dll uses the Windows message queue to notify events, which probably cannot be accessed from Excel. Maybe you can try the old school way, by communicating with the serial port yourself? I believe there is an activex component called MSCOMM that you can use which also has lots of examples
Can you give examples of your making work in Excel VBA of the functions OpenDevice, SendCommand and CloseDevice? I would be grateful, as these offer enough for my MS Access Project.