VM8090 - vba programing

Hi everyone,

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.

Any light about it, please?

Thanks in advance.
Quique

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.

Thank you for your prompt reply VEL448.

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?

Thanks in advance!!!
Quique

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.

In Visual Basic is with:
LRESULT CALLBACK WndProc(
HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam
) {
BYTE cmd;

But no idea how to do it in Excel vba.

Any help (or any sources to look at) out there would be much appreciated, please?

Can’t anybody tell me how I can read the event messages sent by K8090D in EXCEL VBA, please?

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

Thank you very much VEL448.

I also was starting to afraid that it really may not be possible because I’ve tried handling events, handling messages… with no success.

I’ll try with the serial port option. Anyway if I find a way I’ll post here my experiences.

Hi Quique,

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.

Thanx
Jop