Open test.txt For Output As #1

G

garming

Dear Experts,

I am so stuck, please help...

I am using OSX Excel and I am trying to export cells to a text file by
a simple Macro. Unfortunately, some cell values are Japanese and the
result text file shows "_" for Japanese.

Open Test.txt For Output As #1
Print #1, Cells(1, "A").Value
Close #1

I tried:
1. I tried to run the same Macro in XP office 11 Japanese version, it
works fine.

2. In OSX office, I tried to test the Cells(2,"A").Value =
Cells(1,"A").Value, it works fine.

3. In OSX office, I tried msgbox(Cell(1,"A")) and it shows
"_________".

Please help.

Regards,
Sunny.
 
B

Bob Greenblatt

Dear Experts,

I am so stuck, please help...

I am using OSX Excel and I am trying to export cells to a text file by
a simple Macro. Unfortunately, some cell values are Japanese and the
result text file shows "_" for Japanese.

Open Test.txt For Output As #1
Print #1, Cells(1, "A").Value
Close #1

I tried:
1. I tried to run the same Macro in XP office 11 Japanese version, it
works fine.

2. In OSX office, I tried to test the Cells(2,"A").Value =
Cells(1,"A").Value, it works fine.

3. In OSX office, I tried msgbox(Cell(1,"A")) and it shows
"_________".

Please help.

Regards,
Sunny.
It looks like VBA doesn't handle the Unicode characters. I experimented a
bit, and duplicate your results.

Another way, which may work, and be easier, is to simply create a worksheet
that contains the data you want to write, and save the worksheet as a text
file.
 
W

wakabadai

Thank you Bob,

I am now trying saving it in XML. Also, I am now looking at REALBasic
and see what it can do. Thanks for you help.

Regards,
Sunny.


Bob Greenblatt 寫é“:
 

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