+ Reply to Thread
Results 1 to 6 of 6

Loss of characters (? instead)

  1. #1
    Registered User
    Join Date
    07-25-2006
    Posts
    4

    Cool 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

  2. #2
    NickHK
    Guest

    Re: 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" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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. #3
    Registered User
    Join Date
    07-25-2006
    Posts
    4

    Question Estland - Letland

    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.

  4. #4
    Registered User
    Join Date
    07-25-2006
    Posts
    4

    Question Estland - Letland

    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.

  5. #5
    NickHK
    Guest

    Re: 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" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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. #6
    Registered User
    Join Date
    07-25-2006
    Posts
    4

    Talking xlTextPrinter - xlUnicodeText

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

    I works perfect now. Case solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1