Visual Basic, VB6, VBA for LJM - Windows
Visual Basic for Applications (VBA) and Visual Basic 6 (VB6) module and examples for the LJM library.
Prerequisites
A T-series LabJack Device
LJM Library - Install the LJM Library
Applications that support VBA (such as Excel), or Visual Basic 6
Operating System - Windows
Latest Example Package
Includes a VB6 project and a VBA Excel example. For Visual Basic .NET examples, go to the C# and VB .NET examples page.
Note to VBA Users: The VB6 example demonstrates additional LJM usage. VB6 code can be used in VBA, so take a look at the VB6 example as well. The VB6 example's .frm file contains the source code and can be opened in any text editor.
64-bit Support
The LabJackM_VB.bas file included in the download above only works without modification for 32-bit applications. The only requirement to add 64-bit support to the VBA examples is to modify LabJackM_VB.bas to include the PtrSafe
keyword in each function declaration. See an updated 64-bit version of this file at the following link:
https://files.labjack.com/examples/LJM/VBA/LabJackM_VB.bas
Communication Basics
With the LJM library, pretty much everything you might want to do with a device is accomplished by writing and/or reading some registers. Look at the T-series Datasheet or the Modbus Map to determine what registers you need to write and read, then use eWriteName (or eWriteNames) to write the desired registers and eReadName (or eReadNames) to read the desired registers.
Old Versions
Download VBA_LJM_2017_03_06.zip
03/06/2017
Release
Download VBA_LJM_2014_07_28.zip
07/28/2014
Release
File List
VBA_LJM_2017_03_06.zip contains:
LabJackM_VB.bas
LJM_VB6_eFunctions\LJM_VB6_eFunctions.frm
LJM_VB6_eFunctions\LJM_VB6_eFunctions.frx
LJM_VB6_eFunctions\LJM_VB6_eFunctions.vbp
LJM_VBA_eFunctions\LJM_VBA_eFunctions.xls
LJM_VBA_SimpleStream\LJM_VBA_SimpleStream.xls