Mudraker:
(just getting back to this....)
This code works EXCEPT when the file already exists in the folder. I'd like be able to choose not to overwrite the file without it kicking me out of the macro.
This was my attempted solution, but it didn't work. I'm still getting the "regular" saveas dialog prompt. Is there anyway to skip this? I didn't see anything in the help file about using true/false....
Ted
Dim sPath As String
Dim sFName As String
Dim sResp As String
sPath = "F:\QC RECORDS\411 INSPECTION LAYOUT\" & nameCust & Application.PathSeparator
sFName = namePN & " PrtRev_ " & nameRev & " SO_" & nameSO & " ILRev2.xls"
Range("p2") = sPath
If Dir(sPath & sFName, vbNormal) = "" Then
Range("p3") = "Dir(sPath & sFName, vbNormal) is empty"
' File does not exist - add normal save commands here
BookRev2.SaveAs filePath & Application.PathSeparator & namePN & " PrtRev_ " _
& nameRev & " SO_" & nameSO & " ILRev2.xls"
Else
If MsgBox("This file already exists. REV1" & Chr(13) & Chr(13) _
& "Do you want to overwrite it?" & Chr(13) & Chr(13) & "No will put it in the review folder", _
vbYesNo + vbDefaultButton2 + vbQuestion) = vbYes Then
Range("p3") = "Dir(sPath & sFName, vbNormal) is full"
BookRev2.SaveAs filePath & Application.PathSeparator & namePN & " PrtRev_ " _
& nameRev & " SO_" & nameSO & " ILRev2.xls"
Else
BookRev2.SaveAs "F:\QC RECORDS\411 INSPECTION LAYOUT\review files\" & namePN & " PrtRev_ " _
& nameRev & " SO_" & nameSO & " REVIEW DUPLICATE ILRev2.xls"
End If
Bookmarks