The syntax for VB in Excel is wierd to me but the only thing I noticed is that your FileFormat argument is not one of the constants defined for the FileFormat property. try xlWorkbookNormal without quotes.
I have tried the code Format:= _ xlWorkbookNormal which still left the file saving as an 'All files (*.*)', so i have changed the format to what is specified in the 'Save As Type' box.
Any other ideas?
I would paste the full VB but it is more than 2000 chars
I can't really understand what your problem is, you only need the ActiveWorkBook.SaveAs Filename:=fName. The rest of the code is redundant. If you insist then FileFormat:=xlNormal should work. This does in Excel97 and I assume in later versions. I have presumed that you want to save an Excel spreadsheet.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
VB in Excel.
I have written a VB macro in Excel that does a variety of things, and the final one being to save the file.
What i am trying to do is set the fileformat, however; regardless of the coding i always end up with Save as type "All Types(*.*)".
My VB is as follows:
Do
fName = Application.GetSaveAsFilename
Loop Until fName <> False
ActiveWorkbook.SaveAs Filename:=fName, FileFormat:="Microsoft Excel Workbook(*.xls), *.xls", Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
Any clues?