How to print an Excel document in C

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a C program written in Visual Studio .Net 2002.
I have a text file with three fields and 2500 lines that I would like to
print to an Excel document. How can this be done and what header file do I
need?

Thanks guy/lady
 
Hi tmitche!
I have a C program written in Visual Studio .Net 2002.
I have a text file with three fields and 2500 lines that I would like to
print to an Excel document.

"Print to en Excel document" ????
What do you mean with this?

Normally you would print to a printer...

Why not rename the file to *.csv and open it in excel?

How can this be done and what header file do I
need?

The question is not clear...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
He probably means "write" to an Excel file.

And I second Jochen's suggestion to use csv files.
 
And I second Jochen's suggestion to use csv files.Or he could use the XML format that Excel also understands.
Creating a xml file is stupidly simple, it is just a text file, the reading
and parsing, that is another story.
 
Thanks guys. This bit of info is help, however, in VB you are able to define
an application object and a program. e.g.
Dim xl As Object
xl = CreateObject("Excel.Application")
Dim myWorkbooks As Object = xl.Workbooks
xl.Visible = False
myWorkbooks.Open(someExcelFile)
Dim mySheets As Object
mySheets = xl.Workbooks(1).Worksheetsthen the object has a method like
App.Exl

which will allow to create an excel document w/o using a *cvs file.
 
You can do the same from C++ - just google for "automating Excel VC++" to
get some links.
 
Back
Top