Hi
We use this code:
--------------------------------------------------------------------------------
Public Sub MI_InitializeMapInfoConnection()
Dim lb_UnableToCreateObj As Integer
lb_UnableToCreateObj = False
On Error GoTo MI_InitializeMapInfoConnection_Error_MapInfo_Pro
Set MI = CreateObject("MapInfo.Application")
On Error GoTo 0
If lb_UnableToCreateObj Then
On Error GoTo MI_InitializeMapInfoConnection_Error_MapInfo_Run
Set MI = CreateObject("MapInfo.Runtime")
On Error GoTo 0
End If
Exit Sub
MI_InitializeMapInfoConnection_Error_MapInfo_Pro:
'If we can't create the object using MapInfo Pro, we try to use the runtime
lb_UnableToCreateObj = True
Resume Next
MI_InitializeMapInfoConnection_Error_MapInfo_Run:
'If the attempt to create the runtime object also fails we are done.
MsgBox "Impossible to create MapInfo Object"
End
End Sub
--------------------------------------------------------------------------------
Alejandro
Argentina