Hello,
I'm receiving a method 'SaveAs" of object' _workbook failed error when I attempt to save a newly created file on to
a shared drive. I have the correct Directory path, and I am able to access another file within that directory, but
when I attempt to save the file I just created I get that error, and the line that is bolded red is the line that is
highlighted when I click on Debug. Here's the code I'm working with.
Rich (BB code):
Sub CopyNeg()
'Dim OldWb As String
Dim strFullFileName As String
Dim NewWb As Workbook
Dim NewWs As Worksheet
Dim CurWs As Worksheet
'OldWb = objDrv.DriveLetter & ":\SC Support Desk\Negative Replenishment Reports\_CHARTER_REPLEN"
strFullFileName = "\\cable.comcast.com\corp-DFS\CHQ-Shared\SC Support Desk\Negative Replenishment Reports\Negative Replenishment file_" _
& Format(Date, "mm.dd.yyyy") & ".xlsx"
'OldWb.Close
Set CurWs = ActiveWorkbook.Worksheets("Replen Report")
Set NewWb = Workbooks.Add
Set NewWs = NewWb.Sheets(1)
CurWs.Range("A:T").AutoFilter Field:=20, Criteria1:="<0"
CurWs.AutoFilter.Range.EntireRow.Copy
NewWs.Range("A1").PasteSpecial xlPasteValuesAndNumberFormats
NewWb.SaveAs Filename:=strFullFileName, FileFormat:=xlsx
'OldWb.Close
End Sub
D