Saturday, May 22, 2010

Is it possible to get data from Excel when programming in C?

I need to come up with a C program that will use data that have been input in an Excel file and the program must output the results to the Excel file. Is this possible? How? Where can I get more information?

Is it possible to get data from Excel when programming in C?
The easiest way to communicate with an Excel data file is to save it as a .csv file. This is a comma-separated, text version of your Excel data. In an Excel file, try a 'save-as' and choose .csv (comma delimited) file. Then (after closing the file) take a look at what you see by opening that file with wordpad or any text editor. Now you can decide how to label your rows/columns and create your 'c' program appropriately. In 'C' you'll need to be comfortable with file i/o and working with strings to do this sort of thing.





Note that you can have a 'C' program output in this format and open the file with Excel. If you need more info on csv files, check the wikipedia link below. Good luck.
Reply:i have no idea for accessing the excel file from the c program. i think that it will be impossible since excel might have its own method of creating and accessing the file values that we dont know and Microsoft will not share outside unlike opensource community. u can better create a database and access it through linking the program to database and getting the values through querying it. this will make ur program simple and make ur productivity easy since u can concentrate ur attention on program development rather than managing data.


No comments:

Post a Comment