N
nbaj2k
I am trying to generate reports and save the files in a folder, but I
want to create the folder if it does not already exist. If it does
exist, I want it to just save the file there. Right now I am just
setting it to make a directory, which was fine, but if I have other
reports going to that same folder and the folder already exists, I get
a "Path/File Access error" Is there a little line of code I can put in
that first checks to see if the folder exists?
Thanks,
~J
MyDate = Trim(VBA.Format(Now(), "MM-DD-YY"))
Application.DisplayAlerts = False
MkDir "G:\Reports\Friday Reports\" & MyDate
ActiveWorkbook.SaveAs filename:="G:\Reports\Friday Reports\" & _
MyDate & "\" & filename
want to create the folder if it does not already exist. If it does
exist, I want it to just save the file there. Right now I am just
setting it to make a directory, which was fine, but if I have other
reports going to that same folder and the folder already exists, I get
a "Path/File Access error" Is there a little line of code I can put in
that first checks to see if the folder exists?
Thanks,
~J
MyDate = Trim(VBA.Format(Now(), "MM-DD-YY"))
Application.DisplayAlerts = False
MkDir "G:\Reports\Friday Reports\" & MyDate
ActiveWorkbook.SaveAs filename:="G:\Reports\Friday Reports\" & _
MyDate & "\" & filename