I'm having issues with this code not saving my file. I get an error 1004. it worked before. does any one see any issues with this code?
Code:
Option Explicit
Sub SaveAsPDF()
Dim strDir As String
strDir = CreateObject("WScript.Shell").specialfolders("Desktop") & "\Daily Reports\"
If Dir(strDir, vbDirectory) = "" Then
MkDir strDir
Else
'MsgBox "Directory exists."
End If
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Dim fName As String
With ActiveSheet
fName = .Range("C7").Value & " " & .Range("F46").Value
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
strDir & fName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End With
MsgBox "SAVE COMPLETE"
Range("C7") = ""
Range("C9:C45") = ""
End Sub