I am trying to save a record in a CSV file. Whenever I run the macro, I get
an error:
Run-time error '1004'
Method 'SaveAs' of object '_Workbook' failed
My code for this is:
Sub SaveCSV()
Property = Range("[Control.xls]Info!B2").Value
TodaysDate = Format(Now, "dd-mm-yy")
ActiveWorkbook.SaveAs Filename:="C:\Export\Files\" & Property &
TodaysDate & ".csv", _
FileFormat:=xlCSV, CreateBackup:=False
NewSaveName = Property & TodaysDate & ".csv"
End Sub
Any ideas on how to fix this? Help much appreciated.
Your code worked fine for me as long as the folder
C:\Export\Files exists. Are you sure that folder exists?

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
>I am trying to save a record in a CSV file. Whenever I run the
>macro, I get
[quoted text clipped - 16 lines]
>
> Any ideas on how to fix this? Help much appreciated.
dirk rogers - 30 May 2006 23:21 GMT
Yeah, I finally figured that one out after hours of frustration. Thanks for
your reply!

Signature
Thanks, Dirk
> Your code worked fine for me as long as the folder
> C:\Export\Files exists. Are you sure that folder exists?
[quoted text clipped - 19 lines]
> >
> > Any ideas on how to fix this? Help much appreciated.