+ Reply to Thread
Results 1 to 5 of 5

Using COM objects in Excel or VBA?

  1. #1
    Afshar Mohebbi
    Guest

    Using COM objects in Excel or VBA?

    Hello everybody there,

    I wan to use a COM (I've written in VC++) in Excel using its VBA. I
    want to retreive some data with this COM and add it to a Excel
    worksheet.
    Is it possible? How?

    Thanks in Advance,
    Afshar Mohebbi


  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Afshar Mohebbi,

    Your question is really to in depth to answer by post. Microsoft has a good site that should answer your questions. Here is the site to visit http://msdn.microsoft.com/library/de...26d97e1b1d.asp

    Sincerely,
    Leith Ross

  3. #3
    Afshar Mohebbi
    Guest

    Re: Using COM objects in Excel or VBA?

    Hi Leith,
    But this link seems to be about the COM itself, not using it in Excel.
    I've already written and used COM in several cases.

    Regards,
    Afshar

    Leith Ross wrote:
    > Hello Afshar Mohebbi,
    >
    > Your question is really to in depth to answer by post. Microsoft has a
    > good site that should answer your questions. Here is the site to visit
    > http://tinyurl.com/ltl2w
    >
    > Sincerely,
    > Leith Ross
    >
    >
    > --
    > Leith Ross
    > ------------------------------------------------------------------------
    > Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
    > View this thread: http://www.excelforum.com/showthread...hreadid=557658



  4. #4
    NickHK
    Guest

    Re: Using COM objects in Excel or VBA?

    Afshar,
    Basically, you need to add a reference to your components from the Excel
    VBE>Tools>References.
    Then :
    Dim MyInstance As MyCom.MyClass
    Set MyInstance=New MyCom.MyClass

    With MyInstance
    .Dosomething argument1,etc...
    End With

    'Finished, so free up
    Set MyInstance=Nothing

    NickHK

    "Afshar Mohebbi" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Leith,
    > But this link seems to be about the COM itself, not using it in Excel.
    > I've already written and used COM in several cases.
    >
    > Regards,
    > Afshar
    >
    > Leith Ross wrote:
    > > Hello Afshar Mohebbi,
    > >
    > > Your question is really to in depth to answer by post. Microsoft has a
    > > good site that should answer your questions. Here is the site to visit
    > > http://tinyurl.com/ltl2w
    > >
    > > Sincerely,
    > > Leith Ross
    > >
    > >
    > > --
    > > Leith Ross
    > > ------------------------------------------------------------------------
    > > Leith Ross's Profile:

    http://www.excelforum.com/member.php...o&userid=18465
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=557658
    >




  5. #5
    Afshar Mohebbi
    Guest

    Re: Using COM objects in Excel or VBA?

    Hi after a month!!

    NickHK,
    It was very helpfull, I use it in ESRI ArcGIS (ArcMap) a GIS
    application and it worked well.

    Thanks Again
    Afshar


    NickHK wrote:
    > Afshar,
    > Basically, you need to add a reference to your components from the Excel
    > VBE>Tools>References.
    > Then :
    > Dim MyInstance As MyCom.MyClass
    > Set MyInstance=New MyCom.MyClass
    >
    > With MyInstance
    > .Dosomething argument1,etc...
    > End With
    >
    > 'Finished, so free up
    > Set MyInstance=Nothing
    >
    > NickHK
    >
    > "Afshar Mohebbi" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi Leith,
    > > But this link seems to be about the COM itself, not using it in Excel.
    > > I've already written and used COM in several cases.
    > >
    > > Regards,
    > > Afshar
    > >
    > > Leith Ross wrote:
    > > > Hello Afshar Mohebbi,
    > > >
    > > > Your question is really to in depth to answer by post. Microsoft has a
    > > > good site that should answer your questions. Here is the site to visit
    > > > http://tinyurl.com/ltl2w
    > > >
    > > > Sincerely,
    > > > Leith Ross
    > > >
    > > >
    > > > --
    > > > Leith Ross
    > > > ------------------------------------------------------------------------
    > > > Leith Ross's Profile:

    > http://www.excelforum.com/member.php...o&userid=18465
    > > > View this thread:

    > http://www.excelforum.com/showthread...hreadid=557658
    > >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1