View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Using c# object in Excel VBA

I'm kind of stabbing the dark on this one as I've never worked with a C#
object. But have you tried:
msgbox user.propertyname
which would print the value of the propertyname you provide in a message box
on screen. Just put that line right after your Set user = CreateObject(....)
statement and give it a go.

I say that I'm stabbing at it, because that's the way you'd reference a
property in a typical object as:
Set myRange = Range("B1:B9")
msgbox myRange.Rows.Count
would show a 9.

If user is a list you may have to reference the item in the list as:
msgbox user(1).propertyname


"Michael" wrote:

Hi All
I have writen an COM Object in C# to use it in Excel. This Object has a
Function that delivers a List of Users from a Database. My problem is now
that I get the List of Users but it is not posible to get one of the
Properties of the User. But when I create a new Object with
Set user = CreateObject("GuptaIntferface.UserVOCom")
I can see all Properties of this object. My Question is now how can I tell
VBA now that the objects in the List are the UserVOCOM Objects?
thx for help
Michael