SaveAs method, FileFormat

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

SaveAs method, FileFormat

Post by Egg 'n' Bacon »

I'm trying to get our 2007 machines to save a copy of a worksheet in 2003 format. What i'm struggling with is the FileFormat argument.

troouble is, it keeps falling over with a "named argument already specified" error. But I don't know where?

Here's the main bit;

Code: Select all

  MsgTit = ActiveSheet.Name & " saved"
  FPAth = "F:\ISO 18001\Legal Compliance\Compliance Audits\"
  strFullName = FPAth & ActiveSheet.Name & " " & Format(Date, "MMYY") ' & ".xls"
  If Dir(strFullName) = "" Then
    ' File does not exist yet
    ActiveSheet.Copy
    ActiveWorkbook.SaveAs , Filename:=strFullName, FileFormat:=xlExcel9795

User avatar
HansV
Administrator
Posts: 78483
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SaveAs method, FileFormat

Post by HansV »

There shouldn't be a comma after SaveAs, Excel thinks you omitted an argument before the comma.

FileFormat:=xlExcel9795 will save the workbook in format that's compatible with both Excel 95 and with Excel 97-2003. I wouldn't recommend using that. Instead, use FileFormat:=xlExcel8. This will save the workbook in Excel 97-2003 format.
Best wishes,
Hans

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

Re: SaveAs method, FileFormat

Post by Egg 'n' Bacon »

Cheer Hans, just what I needed