Example of an Excel VBA application using the connect function:
'Example Using the connect Function
Sub MooConnectExample()
If addIn Is Nothing Then
Set addIn = Application.COMAddIns("MooXL")
Set mooAutoObj = addIn.Object
End If
Call mooAutoObj.Connect
If Not mooAutoObj.Connected() Then
'Check if we connected ok
Debug.Print "Could Not Connect"
Else
MsgBox "Connected"
End If
End Sub
The connected function can be used to determine if a connection is currently open to Oracle OLAP
connected () returns a boolean TRUE if a connection is current else FALSE. If the source of a failed connection is known by moo the error message can be retrieved by calling the getLastMooError function..
Microsoft®, WINDOWS®, Microsoft Excel®, Microsoft Office® are registered trademarks of Microsoft Corporation.
ORACLE® is a registered trademark of ORACLE Corporation.
® SDMC Consulting Limited 2010