You cannot write directly to an *.xls file and expect Excel to read it because *.xls files are not plain text files -- they contain a lot of formatting information that is readable only by Excel program.
The easiest way to do it is to creates *.csv files which Excel can import. Fieids (cells) are commma or sometimes tab separated, with CR/LF between each row. Using your example you might write it like this: Text should be surrounded with quotes (see first example below)
myfile << "\"Hello World\"," << nums << "," << nums << "," nums << "\n"; or myfile << nums << "\t" << nums << "\t" nums << "\n";
Above thing is correct to write in csv but I am facing one problem to write it in csv as html editor code cannot be write as csv as it generates error on csv file writing.Due to this the only way is to write an excel file as data in html format can also be write.
Here in writing excel file I have an script which I used in writing it but while reading it using another script for excel it generates an error as mentioned below:-
"The filename shipaccountactivity1.xls is not readable"
Can u plz help me in above case as how can I write it so that it can easily be readable.......
Thanks in advance.....