Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel SaveAs method - requires file format??? 1

Status
Not open for further replies.

sodakotahusker

Programmer
Mar 15, 2001
601
Where do I find the list of potential formats for the SaveAs command? I found xlCSV on a sample somewhere. I just want to save in Excel format. I don't get any intellisense help that guides me to this answer. How do I save as Excel??
 
If you use Type.Missing as the file format argument of SaveAs you will get the Excel format by default.

If you want to see a list of the available formats, open Object Browser and look in the interop.excel assembly. There is an enum called xlFileFormat which contains all the possible formats.
 
Thank you very much SHelton! Just what the doctor ordered!
 
xlDoc.SaveAs("c:\temp.csv", FileFormat:=Excel.XlFileFormat.xlCSVWindows, AddToMru:=False, TextVisualLayout:=Excel.XlTextVisualLayoutType.xlTextVisualLTR, CreateBackup:=True)

xlDoc is an object of type Excel.Worksheet

Intellisense *will* show you the enumeration possibilities. Just try it by typing something similar in VB.

After typing "FileFormat:=Excel.XlFileFormat." intellisense will popup the possibilities for the XlFileFormat enumeration.

Regards, Ruffnekk
---
Is it true that cannibals don't eat clowns because they taste funny?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top