Hello all,
I am a newbie, so please be kind. I have been trying to correct this code for 2 days, and must admit I need help. I'm sure it's something simple, but can't crack it.
I am using Excel 2007 and saving to a shared drive.
I'm attempting to create a new folder, based on specific information in the workbook. If the folder already exists, I just need the workbook saved.
The workbook also needs to be saved/named based on specific information in the workbook.
The current code I have is:
Sub SaveAs()
Dim evnfol, newfol, sfile As String
envfol = "\\MATTHEW-HP\Users\Matthew\Desktop\SCRATCH\Events\2013\"
newfol = Format(CStr(Range("a13").Text), "mm.dd.yyyy") & Range("a9").Value & Range("b9").Value
sfile = Format(CStr(Range("a13").Text), "mm.dd.yyyy") & Range("a9").Value & Range("b9").Value & Range("a11").Value
If Len(Dir(envfol & newfol, vbDirectory)) = "" Then
MkDir newfol
End If
ActiveWorkbook.SaveAs Filename:="envfol & newfol & " \ " & sfile", FileFormat:=52, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
Right now I'm receiving a error 13 type mismatch.
Earlier today I was receving a error 1004 Method SaveAs of Workbook failed
Thank you in advance for your assistance.
Jenn
Bookmarks