ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP - Communicating between C++ and VBA (https://www.excelbanter.com/excel-programming/271604-help-communicating-between-c-vba.html)

Benoit[_2_]

HELP - Communicating between C++ and VBA
 
Hi,

I have an Excel Spreadsheet that needs to be populated by
information coming from a C++ code. I know I could have
the C++ code create an output such as a .csv file and have
the VBA code subsequently read this file. However, the
trick is that the whole process needs to be very fast,
where are talking pretty much about live updating… The C++
code will continuously be computing and modifying the
results so unless using an intermediary such as a .csv
file can be made so that it is really fast I think it
would be better to have the VBA code directly talking with
the C++ code or something similar. So does anybody has a
clue how a VBA code doing such a thing could be achieved?

Thanks


Bob Kilmer

HELP - Communicating between C++ and VBA
 
http://support.microsoft.com/default...NoWebContent=1


"Benoit" wrote in message
...
Hi,

I have an Excel Spreadsheet that needs to be populated by
information coming from a C++ code. I know I could have
the C++ code create an output such as a .csv file and have
the VBA code subsequently read this file. However, the
trick is that the whole process needs to be very fast,
where are talking pretty much about live updating… The C++
code will continuously be computing and modifying the
results so unless using an intermediary such as a .csv
file can be made so that it is really fast I think it
would be better to have the VBA code directly talking with
the C++ code or something similar. So does anybody has a
clue how a VBA code doing such a thing could be achieved?

Thanks




Aaron Queenan

HELP - Communicating between C++ and VBA
 
If you're supporting Excel XP and later, use the RTD function, which allows
a COM component to return real-time data (sort of) to Excel.

If you need to support older versions, you can use DDE (not recommended) or
COM server (using Excel as an automation server) or COM client (using VBA
code within Excel to control a COM object implemented in C++).

Regards,
Aaron Queenan.

"Bob Kilmer" wrote in message
...
I don't know as much C++ as I'd like to but I'd be surprised if C++

couldn't
talk directly to Excel. Don't we call the likes of Excel an ActiveX

(a.k.a.,
COM) automation server? C++ should be able to create an instance of Excel
and, using its object model, pour the data right in, I would think.

Bob Kilmer

"Benoit" wrote in message
...
Hi,

I have an Excel Spreadsheet that needs to be populated by
information coming from a C++ code. I know I could have
the C++ code create an output such as a .csv file and have
the VBA code subsequently read this file. However, the
trick is that the whole process needs to be very fast,
where are talking pretty much about live updating… The C++
code will continuously be computing and modifying the
results so unless using an intermediary such as a .csv
file can be made so that it is really fast I think it
would be better to have the VBA code directly talking with
the C++ code or something similar. So does anybody has a
clue how a VBA code doing such a thing could be achieved?

Thanks







All times are GMT +1. The time now is 08:48 AM.

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