Loading the Library in SBM AppScript

To load a DLL in SBM AppScript, you first need to create an SBM Library object using the CreateObject function call.

Dim ttLib
Set ttLib = CreateObject ("TeamTrackLibrary")

Once the object is created, tell the object which DLL you want to call functions in by calling SetLibraryName on the TeamTrackLibrary object. You can specify the path in one of three ways.

Additionally, if you are going to use an absolute path to specify the library to load, you must also include the extension. The extension is not assumed when using an absolute path; it is only assumed if you are going to rely on the ScriptAppPath.

Once you've told the library object which library you want to load, call LoadLibrary to actually get the library loaded. For example:

Call ttLib.LoadLibrary()

LoadLibrary() returns a Boolean which indicates the success or failure of the operation. To avoid experiencing a runtime exception, always check the return value of LoadLibrary() prior to calling any functions in the DLL. For example:

If ttLib.LoadLibrary()  Then
	Call ttLib.my_function()
End If