ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   When is "?" really a "?" (.SaveAs with Chinese chars) (https://www.excelbanter.com/excel-programming/291270-when-really-saveas-chinese-chars.html)

Nick Cranham

When is "?" really a "?" (.SaveAs with Chinese chars)
 
Working with W2K English and Office 2000, but connected to network running
W2K Chinese.

Using Workbook.SaveAs FileNamePath in VBA, where FileNamePath is generated
form work sheet data. The problem arises when FileNamePath contains Chinese
characters and .SaveAs fails with "..illegal characters...".
This is true to the extent that the Chinese characters are displayed as "?",
as expected with English VB.
I can use If AscW("?")=AcsW(MyChineseChar) to strip these out, but I'm
somewhat confused as why the string functions appear to behave differently
with such characters.
e.g.
Assuming MyChineseString="???-abc" , where the ? are really Chinese chars
MyChineseChar=Left(MyChineseString,1)
Instr(1,MyChineseChar,"?")=0 <---so it's not really a "?"
But
Asc(MyChineseChar)=63 <---yes it is

As a follow up, how can I save the file with Chinese chars in the name ?

NickHK





All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com