Complete noob to VBA but I am TRYING to get my head round it...I have this code and whilst it is mostly doing what I want it to do I can't stop it saving as a PDF when I need it to be an Excel workbook that it saves as. I have changed the word PDF to xlsm everywhere I can see it but it just then saves as XXXX.xslm.pdf
Can anyone help please?
Sub SaveAs()
Dim SavePath As String
Dim SaveAs As String
Dim FileName As String
Dim sDate As String
'// Save it Path
SavePath = "S:\Customer Services\E-Timesheets NEW\"
'// File Name
FileName = "Timesheet WE "
'// Format the on "C3" to TEXT
sName = Format(Sheets("Blank Timesheet").Range("C3"), "TEXT")
'// Format the on "B4" to YYYY-MM-DD
sDate = Format(Sheets("Blank Timesheet").Range("AP5"), "DD-MM-YYYY")
'// Save with File Name & Date & .pdf
SaveAs = FileName & sDate & sName & ".pdf"
Application.DisplayAlerts = True
'// Export Active Sheet as pdf
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
SavePath & SaveAs
Application.DisplayAlerts = True
End Sub
Bookmarks