This code snippet works fine from vb.net, however, I can't get a connection from Excel. I added a reference to SAPbobsCOM. Everything is fine up until I call .connect.
Dim vCompany As SAPbobsCOM.Company
Set vCompany = New SAPbobsCOM.Company
'set parameters for connection
vCompany.CompanyDB = "MyCompany"
vCompany.Password = "MyPassword"
vCompany.UserName = "MyUsername"
vCompany.Server = "MyServer"
vCompany.UseTrusted = False
vCompany.DbUserName = "MyDBUsername"
vCompany.DbPassword = "MyDBPassword"
If vCompany.Connect <> 0 Then
MsgBox "Failed to connect"