View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Michael Michael is offline
external usenet poster
 
Posts: 791
Default Using c# object in Excel VBA

thx for the Results
@Tim: Yes I allready added the reference
@JLatham: I had the some Idea like you with user(1).propertyname but then I
get the Error Message Runtime Error 424 Object necessary

I tried the following lines and all lines failed :(
user2 = Users(i)
objSheet.Range(cell).Value = Users(i).UserName
objSheet.Range(cell).Value = user2.UserName
thx for Help Michael

Here is my complete Code:

Sub Schaltfläche2_BeiKlick()
Set obj = CreateObject("GuptaIntferface.Wrapper")
Set objSheet = Worksheets("Tabelle1")
UserName = objSheet.Range("B1").Value
Password = objSheet.Range("B2").Value
workspace = objSheet.Range("B3").Value
mandant = objSheet.Range("B4").Value
resultnix = obj.InitWrapper(UserName, "", workspace, mandant)
resultnix = obj.RegisterHostaddress("Ibs.Infrastructure",
"http://localhost/Infrastructure.Host/")
result = obj.Test()
Users = obj.GetUserList()
Set user = CreateObject("GuptaIntferface.UserVOCom")
MsgBox user.UserName
For i = 1 To UBound(Users)
cell = "B" + CStr(i + 10)
user2 = Users(i)
objSheet.Range(cell).Value = Users(i).UserName
objSheet.Range(cell).Value = user2.UserName
Next i
MsgBox result
End Sub