Hi:
I think that you need to reference to License Server including the port.
This code works well for me:
oCompany.Server = txtServer
oCompany.LicenseServer = txtServer & ":" & txtPort
oCompany.UseTrusted = False
oCompany.DbServerType = dst_MSSQL2012
oCompany.DbUserName = "sa" 'You can replace this with a proper SQL user
oCompany.DbPassword = B1DBPassword 'Replace with a variable or password text
oCompany.CompanyDB = lbCompanies.Value 'Reference a list box object, replace with DB name
oCompany.UserName = txtUser
oCompany.Password = txtPass
lRetCode = oCompany.Connect()
If lRetCode <> 0 Then
ErrCod = oCompany.GetLastErrorCode
ErrMsg = oCompany.GetLastErrorDescription
MsgBox (CStr(ErrCod) & ": " & ErrMsg)
Application.StatusBar = (CStr(ErrCod) & ": " & ErrMsg)
Else
ExcelStatBar = "Conectado a: " & oCompany.CompanyName & "; Usuario: " & txtUser
Application.StatusBar = ExcelStatBar
End If