Hi,
I for the life of me cannot figure out why the 'path will not save the file but if I use the M: drive it works just fine. I have triple checked that M:/ = \\office\group11\. I have screwed with it for hours with no luck. I continue to get a Method 'SaveAs' of object'_Workbook' failed error on the asterisked path. Any advice would be helpful.
I for the life of me cannot figure out why the 'path will not save the file but if I use the M: drive it works just fine. I have triple checked that M:/ = \\office\group11\. I have screwed with it for hours with no luck. I continue to get a Method 'SaveAs' of object'_Workbook' failed error on the asterisked path. Any advice would be helpful.
Code:
Sub Run()
Dim path As String
iyear = Year(Date)
d = DateAdd("m", -1, Now)
b = Month(d)
f = MonthName(b)
a = "\" & Format(d, "mm") & ". " & f & " " & iyear
'path = "\\office\group11\T & A\DS\RTF Report\Source Reports\" & iyear & a
Filename = "RTF" & " " & f & " " & iyear & ".xlsm"
path = "M:\T & A\DS\RTF Report\Source Reports\" & iyear & a
MsgBox path & "\" & Filename
ActiveWorkbook.SaveAs path & "\" & Filename, xlOpenXMLWorkbookMacroEnabled
MsgBox "File has been saved, prep email using CTL+R"
End Sub