Point me in the right direction: Running a C++ program with excel

Think
04-24-2008, 07:57 AM
Hey guys, I have just started a work term writing simulation programs at Dalhousie University.

I am writing the simulations in C++. These simulation files take input data (parameters and coeficients) and I am currently reading them from a text file.

I was wondering if I can create an excel spreadsheet, that would allow an untrained user to enter in these coeficients. When they have entered all the values into the labeled spreadsheet, I would like a button for them to press that would export this data to a text data file, and another button that will run my simulation with this text file. If i am feeling energetic I would also like to feed the program output back into excel.

I have no idea how to do this at all, So if anyone has done this before, or can point me in the right direction of what I need to learn, that would be great.

Thanks, -paul

Mill
04-25-2008, 06:39 AM
I'd say, look in your Excel VBA help file for the "Write #" statement. That should help with outputting the data to a text file.

Assuming the C++ file is a compiled executable, you can run it using the Shell function.

Finally, if that C++ file also outputs data to a text file, you can read it back into Excel using the Input # statement.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum