How can I know if Excel supports the fileformat constant?
Liu Jianzhong,
I guess you are working on a Chinese system.
I can confirm your code works fine on English W2K and Office2K, but errors
on (Traditional) Chinese W2K and Chinese Office.
Can't tell you why, but I guess you will just have to trap error or use a
format that you know works in all languages.
NickHK
"ExcelReport" wrote in message
...
My Excel version is Excel 2003. I tried the below code, and get a run-time
error.
ActiveWorkbook.SaveAs "C:\test.txt", xlTextMSDOS ' Error,
Err.Number=1004
I tested some fileformat constants, some are ok and some do not work.
ActiveWorkbook.SaveAs "C:\test.txt", 21 ' Error,
Err.Number=1004
ActiveWorkbook.SaveAs "C:\test.txt", xlCSVMSDOS ' Error,
Err.Number=1004
ActiveWorkbook.SaveAs "C:\test.txt", xlCurrentPlatformText 'OK
ActiveWorkbook.SaveAs "C:\test.txt", xlCSV 'OK
I donot know why. I guesss the reason is the environment on my computer.
My
question is:
How can I know if Excel supports the fileformat constant before I use it?
|