Saving File

  • Thread starter Thread starter Nick S
  • Start date Start date
N

Nick S

I have the following code

Sub SaveAsCSV()
ActiveWorkbook.SaveAs Filename = "\\Fiesta\Wg_memb_sec\Community
Dividend\New Payments\Admin\Chq details\CommDiviChqs.csv", _
FileFormat:=xlCSVWindows, CreateBackup:=False
ActiveWorkbook.Saved = True
ActiveWorkbook.Close

End Sub

When I run the code, the file is saved in the right location but with
the name False.csv.

Can anybody help please.

Thanks in advance

Nick
 
Hello NIck,

Looks like a typo. You forgot tp put the colon after filename.

FileName:="\\Fiesta\Wg_memb_sec\Community Dividend\New
Payments\Admin\Chq details\CommDiviChqs.csv", _


Sincerely,
Leith Ross
 
In addition, you can replace these two lines

ActiveWorkbook.Saved = True
ActiveWorkbook.Close

with the much cleaner

ActiveWorkbook.Close SaveChanges:=False
 
Back
Top