ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using COM objects in Excel or VBA? (https://www.excelbanter.com/excel-programming/366064-using-com-objects-excel-vba.html)

Afshar Mohebbi

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


Leith Ross[_620_]

Using COM objects in Excel or VBA?
 

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


Afshar Mohebbi

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



NickHK

Using COM objects in Excel or VBA?
 
Afshar,
Basically, you need to add a reference to your components from the Excel
VBEToolsReferences.
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" wrote in message
oups.com...
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




Afshar Mohebbi

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
VBEToolsReferences.
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" wrote in message
oups.com...
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




All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com