Craig
Craig

Reputation: 65

How to Show C++ Results in Excel

I am trying to create C++ code that allows User Input in selecting a variety of fields, then it will calculate many different angles and show the users the results, as well as a graph.

However, it has been suggested to us by our lecturer that it may be a good idea to write the code to these calculations etc in C++, then input the results into Excel.

Does anyone have any idea how to do this? Literally looking for a way for the user to fill in the required values on C++ and then to be AUTOMATICALLY taken to the excel file to show the results in the table and graph format.

If this is not possible, is there a way to display the results in the table and graph format through C++?

Thanks very much in advance

Upvotes: 2

Views: 2806

Answers (2)

John Bandela
John Bandela

Reputation: 2436

Use COM Automation to automate excel.

The best way to do this is to use the vole library by Matthew Wilson at

http://vole.sourceforge.net/

Take a look at the examples. I do not think there is an example for excel, but there is one for microsoft word at http://www.codeproject.com/KB/COM/VOLE_word.aspx

I have used vole in the past, and it makes it a whole lot easier

Upvotes: 0

user227466
user227466

Reputation:

Excel provides COM interface which you can use from your C++ application.

This can be done in the way described in this article:

http://support.microsoft.com/kb/216686

This link might also be useful:

http://www.codeproject.com/Articles/10886/How-to-use-Managed-C-to-Automate-Excel

I think the second link would be better for you as its more of a step by step guide which should help you to workout the answer.

Upvotes: 2

Related Questions