Keep getting the above error on the
VBA Code:
ActiveWorkbook.SaveAs Filename:="C:\LOGS\" & "DEC" & " " & "RSS LOGS" & ".xlsx", FileFormat:=51
The wired part is that the new workbook gets named DEC RSS LOGS however it does not save in the file path nor does it allow me to manually save it I get the following message
VBA Code:
Sub ExportEL()
Application.ScreenUpdating = False
Dim srcWS As Worksheet, x As Long, rDate As Date
Set srcWS = ThisWorkbook.Sheets("RSS LOGS")
rDate = srcWS.Range("K1")
x = Day(Format(Excel.Application.WorksheetFunction.EoMonth(srcWS.Range("K1").Value2, 0), "yyyy-mm-dd"))
Workbooks.Add 1
For x = 0 To x - 1
srcWS.Copy after:=Sheets(Sheets.Count)
ActiveSheet.Name = Format(rDate + x, "dd")
Range("K1") = Range("K1") + x
Next x
Application.DisplayAlerts = False
Sheets(1).Delete
Application.DisplayAlerts = True
ActiveWorkbook.SaveAs Filename:="C:\LOGS\" & "DEC" & " " & "RSS LOGS" & ".xlsx", FileFormat:=51
Application.ScreenUpdating = True
End Sub
Attachments