Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loss of characters (? instead)


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


--
IngDah_Blk
------------------------------------------------------------------------
IngDah_Blk's Profile: http://www.excelforum.com/member.php...o&userid=36754
View this thread: http://www.excelforum.com/showthread...hreadid=564708

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Loss of characters (? instead)

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

"IngDah_Blk" wrote
in message ...

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


--
IngDah_Blk
------------------------------------------------------------------------
IngDah_Blk's Profile:

http://www.excelforum.com/member.php...o&userid=36754
View this thread: http://www.excelforum.com/showthread...hreadid=564708



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loss of characters (? instead)


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

--
IngDah_Bl
-----------------------------------------------------------------------
IngDah_Blk's Profile: http://www.excelforum.com/member.php...fo&userid=3675
View this thread: http://www.excelforum.com/showthread.php?threadid=56470

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loss of characters (? instead)


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

--
IngDah_Bl
-----------------------------------------------------------------------
IngDah_Blk's Profile: http://www.excelforum.com/member.php...fo&userid=3675
View this thread: http://www.excelforum.com/showthread.php?threadid=56470

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Loss of characters (? instead)

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

"IngDah_Blk" wrote
in message ...

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


--
IngDah_Blk
------------------------------------------------------------------------
IngDah_Blk's Profile:

http://www.excelforum.com/member.php...o&userid=36754
View this thread: http://www.excelforum.com/showthread...hreadid=564708





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loss of characters (? instead)


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. :

--
IngDah_Bl
-----------------------------------------------------------------------
IngDah_Blk's Profile: http://www.excelforum.com/member.php...fo&userid=3675
View this thread: http://www.excelforum.com/showthread.php?threadid=56470

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hardship letter explaining devastating loss property loss financi carol Excel Discussion (Misc queries) 1 June 12th 09 02:13 PM
convert 5 characters in a cell to 6 characters by adding a zero Helenf Excel Discussion (Misc queries) 4 May 18th 09 04:43 PM
Insert Leading Characters If String Is Only 7 Characters Paperback Writer Excel Discussion (Misc queries) 2 April 21st 09 09:07 PM
In Excel find characters when multiple characters exist w/i a cel teacher-deburg Excel Worksheet Functions 1 December 5th 05 10:22 PM
Weight loss line chart to monitor weight loss progress S Fox Charts and Charting in Excel 6 November 8th 05 05:10 PM


All times are GMT +1. The time now is 10:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"