View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ExcelReport ExcelReport is offline
external usenet poster
 
Posts: 8
Default How can I know if Excel supports the fileformat constant?

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?