Loss of characters (? instead)

I

IngDah_Blk

A colleague of mine (who has left) wrote a macro for moving a .xls file
to another environment. Until now it worked fine.

The characterset in the .xls file supports characters like
ĻĒŪĪ, etc.
The resultfile however does not contain any of these characters, but a
question mark instead (?). What is wrong in the code?

Workbooks.OpenText Filename:=MyInput, Origin:=28603 _
, StartRow:=1, DataType:=xlFixedWidth,
FieldInfo:=Array(Array(0, 1), Array( _
48, 1)), TrailingMinusNumbers:=True

ActiveWorkbook.SaveAs Filename:=MyFile, FileFormat:= _
xlTextPrinter, CreateBackup:=False

Thanks for any response,
Ingrid
 
N

NickHK

I find code page/character set stuff confusing, but it seems that you are
opening a text file with a code page of 28603, Estonian (ISO), then saving
as a .PRN file.
Not sure, but does the output of xlTextPrinter depend on the capabilities of
ActivePrinter ?
e.g. One printer may be able to represent your file correctly, but another
may not.

NickHK
 
I

IngDah_Blk

Thanks for the response.
I was not aware that 28603 was the codepage for Estland, although
know the macro is for Estland.
The major change I want to make, is making this macro suitable voo
Letland, because it doesn't now.
According to the documentation of codepages, 28603 is the codepage fo
ISO 8859-13 Latin 7 (Baltic) which should also support Letlan
characters.
I haven't used a printer yet, I just open the created file with Word o
Excel and then the ? appear
 
I

IngDah_Blk

Thanks for the response.
I was not aware that 28603 was the codepage for Estland, although
know the macro is for Estland.
The major change I want to make, is making this macro suitable voo
Letland, because it doesn't now.
According to the documentation of codepages, 28603 is the codepage fo
ISO 8859-13 Latin 7 (Baltic) which should also support Letlan
characters.
I haven't used a printer yet, I just open the created file with Word o
Excel and then the ? appear
 
N

NickHK

As far as I can tell, saving the file as xlTextPrinter only includes ANSI
characters, so anything greater than ASC(255) will appear as a "?".
If you use xlUnicodeText instead, does it work correctly ?

There is also the TextCodePage argument to the .SaveAs method, but as the
help says "Not used in U.S. English Microsoft Excel", I can't tell you if it
would help you.

NickHK
 
I

IngDah_Blk

Thanks again for your help.
After changing xlTextPrinter into xlUnicodeText the created file show
the Letvia characters I had put in.

I works perfect now. Case solved. :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top