ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving File (https://www.excelbanter.com/excel-programming/343804-saving-file.html)

Nick S[_11_]

Saving File
 

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


--
Nick S
------------------------------------------------------------------------
Nick S's Profile: http://www.excelforum.com/member.php...o&userid=16512
View this thread: http://www.excelforum.com/showthread...hreadid=479170


Leith Ross[_114_]

Saving File
 

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


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=479170


Tom Ogilvy

Saving File
 
In addition, you can replace these two lines

ActiveWorkbook.Saved = True
ActiveWorkbook.Close

with the much cleaner

ActiveWorkbook.Close SaveChanges:=False

--
Regards,
Tom Ogilvy

"Leith Ross" wrote
in message ...

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


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:

http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=479170




Nick S[_12_]

Saving File
 

Thanks that was driving me nut

--
Nick
-----------------------------------------------------------------------
Nick S's Profile: http://www.excelforum.com/member.php...fo&userid=1651
View this thread: http://www.excelforum.com/showthread.php?threadid=47917



All times are GMT +1. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com