View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default The Print # command print not all rows from excel sheet to file

I don't use XML much, but it seems that your files are encoded but the XML
declaration does not include the encoding used. Hence Excel fails because it
assumes UTF-8, which is wrong.
Maybe one of these will help
http://msdn.microsoft.com/msdnmag/issues/01/05/xml/
http://www.w3.org/TR/2004/REC-xml-20.../#sec-guessing

VBA can still work with these files, but you have to allow for the
differences between these and normal ANSI files, which was assumed for the
code before.

You can send me a sample of the XML file if you want and I can see what you
have.


But I recommend you read up on encoding, XML and how Excel deals with both
of those, as I do not know much : ) .

NickHK

"pieros" wrote in message
ups.com...
Anyway, thanks NickHK for your help sofar. I will try what you suggest
and hope it will work.

Thanks again,
Pieros.


NickHK wrote:
If you get that error, then you have text files with Unicode encoding.

As
such, this code will not work.

You can adapt this :
http://support.microsoft.com/kb/193540

Or maybe use the FSO:
http://www.aivosto.com/visdev/fso.html

However, as your file are XML, you can open them directly in XL2002.
However, with your file, I get an error, as the first line "<?xml
version="1.0"?" is invalid.
Not sure how Excel would handle the encoding either.

NickHK