All,
It is driving me nuts! I have the following code -
Private Sub CommandButton2_Click()
Const sLOG As String = "Shift Hand Off Notes - "
Const sFILEFILTER As String = "Excel files (*.xls),*.xls"
Dim sInitialFileName As String
Dim v
ActiveSheet.Unprotect
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
With Setup
sInitialFileName = sLOG & Worksheets("Hand-off Notes").Range("K1").Value & " - " & Worksheets("Hand-off Notes").Range("F2").Value & " - " & FormatDateTime(Date, vbLongDate)
End With
v = Application.GetSaveAsFilename _
(InitialFileName:=sInitialFileName, _
filefilter:=sFILEFILTER)
Me.Application.DefaultFilePath = "S:\share\dc\LP\LP Hand-off\DC 840"
If v = False Then
MsgBox "You have cancelled sending the Shift Hand Off Notes"
Else
ActiveWorkbook.SaveAs Filename:=sInitialFileName
ThisWorkbook.SendMail Recipients:=("DC-BLLP@kohls.com,
bob.carter@kohls.com")
Subject = ("Shift Hand-off Notes For") & Format(Date, "dd/mm/yyyy")
End If
End Sub
Everything is working except I cannot get it to point to the file path I have set up in the Me.Application.DefaultFilePath line.
Any suggestions?