Hello, I am trying to connect to a CaliberRM 2008 server using VBA from Excel. In order to access the CaliberRM objects, I added a reference to CaliberRMSDK100.dll (Program Files (x86)\Borland\CaliberRM SDK 2008\lib). The VBA code is: Sub Initialize() On Error GoTo error ' The Initializer object is responsible for loading the Java VM. Dim objInitializer As New Initializer 'IStJavaVMInfo describes a Java VM. Dim objStJavaVMInfo As IStJavaVMInfo ' Get the current VM from the initializer... Set objStJavaVMInfo = objInitializer.JavaConfiguration.CurrentJavaVM error: If Err.Number 0 Then MsgBox Err.Description End If End Sub Sub ConnectCaliberRM() On Error Resume Next Call Initialize ' Declare object variables for Caliber ' server factory, server and session objects. Dim objServerFact As CaliberServerFactory Dim objServer As CaliberServer Dim objSession As Session ' Assign object references to the server and ' server factory variables. Set objServerFact = New CaliberServerFactory Set objServer = objServerFact.Create("server:port") ' Assign an object reference to the session ' variable by logging in to the Caliber server. objSession = objServer.login("user", "pass") .......... End Sub When I run the ConnectCaliberRM macro, the line Dim objInitializer As New Initializer doesn't initialize the objInitializer object and an error occures on line Set objStJavaVMInfo = objInitializer.JavaConfiguration.CurrentJavaVM ("ActiveX component can't create object") I used the same code to connect to CaliberRM from a Visual Basic 2010 Windows Form application and it works. This application references CaliberRMSDK100.NET.dll. I don't understant what is wrong in the Excel macro. Is there any difference between the two libraries? Thanks
↧