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?
Bookmarks