--- In [email protected], Thomas Hruska <[EMAIL PROTECTED]> wrote:
>
> Brett McCoy wrote:
> > On Nov 4, 2007 12:48 PM, hamed abooie <[EMAIL PROTECTED]> wrote:
> > 
> >> because i neede it foe a project which might be needed
> >> this conversion 100 times thats why I can not do it
> >> manually and it should be done by a program.
> > 
> > Another option is to connect to Excel using ODBC and query
> > for data and write the data out to a text file with your
> > program.
> > 
> >> ed <[EMAIL PROTECTED]> wrote:
> >>           On Sun, 4 Nov 2007 12:16:55 -0400
> >> "Brett McCoy" <[EMAIL PROTECTED]> wrote:
> >>
> >>> Didn't a similar question come up last week about
> >>> exporting data from Excel? Excel can directly export
> >>> to character-delimited text -- I imagine there is a
> >>> COM object one can use in C++ to do this (although
> >>> I imagine it's far easier to do with Excel macro
> >>> scripting or VBA).
> 
> Oooh.  I like that idea.  ODBC is potentially a much cleaner
> approach than COM in C/C++.  Setting up the datasource for
> 100 different spreadsheets might be difficult, but if the OS
> is NT-based, open files can usually be renamed...
> 
> Yes, there is a COM interface.  However, you can probably
> access it more easily using VBS than C/C++.  In fact, a
> VBS script might be the way to go for extracting the data.
> Then you can use C/C++ to process the resulting file into
> the final format.

Please don't beat me for this suggestion, but why reinvent the wheel?
There are fairly good Java classes available (if I recall correctly,
the stuff is named POI) to extract all sorts of information from Excel
sheets (in fact from all sorts of MS Office documents). Then just
interface the Java classes with your C/C++ code using JNI (Java Native
Invocation), and off you go.

Is this sort of homework? Otherwise I would strongly suggest to take a
look at this approach, even though it's not C/C++ centric.

Just another funny idea from the old wannabe know-it-all.

Regards,
Nico

Reply via email to