J Joseph Nov 12, 2004 #1 Hi Tom, I just got a method 'saveas' of object 'workbook' failed. Any Ideas? Cheer
T Tom Ogilvy Nov 12, 2004 #2 I changed P to C and created you structure. This revision worked fine for me. (I changed C back to P). Sub AAAA() sName = "P:\clevedon staff\activities\" & _ Application.UserName & "\" & Application.UserName _ & " " & Format(Now, "DDMMYY") & " ActivityLog.csv" If Dir(sName) <> "" Then Kill sName End If Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:= _ sName, FileFormat:=xlCSV, _ Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, _ CreateBackup:=False ActiveWorkbook.Saved = True Application.Quit Application.DisplayAlerts = True End Sub
I changed P to C and created you structure. This revision worked fine for me. (I changed C back to P). Sub AAAA() sName = "P:\clevedon staff\activities\" & _ Application.UserName & "\" & Application.UserName _ & " " & Format(Now, "DDMMYY") & " ActivityLog.csv" If Dir(sName) <> "" Then Kill sName End If Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:= _ sName, FileFormat:=xlCSV, _ Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, _ CreateBackup:=False ActiveWorkbook.Saved = True Application.Quit Application.DisplayAlerts = True End Sub