Dears i write the code with many ways but each time give me the error in picture at attachment so could you please help me to know where is the problem to fix it give me error for this there line
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFN, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True[/COLOR]
here is the code
Sub Nextinvoice()
Range("c1").Value = Range("c1").Value + 1
Range("b18:C167").ClearContents
Range("D18").Select
End Sub
Sub GermanysewingordersaveAsPDF()
ActiveSheet.Protect Password:="123456", DrawingObjects:=True, _
Contents:=True, Scenarios:=True, AllowFiltering:=True, _
userinterfaceonly:=True
Range("D18").Select
Selection.AutoFilterAttachment 376782
ActiveSheet.Range("$B$18:$V$167").AutoFilter Field:=3, Criteria1:="<>"
NewFN = "D:\OFFICE\P-ORDER\Germany order\KNITING GER ORDER\" & Range("D2").Value & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFN, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True[/COLOR]
Nextinvoice
Selection.AutoFilter
Sheets("Groz-Beckert order kNITING").Select
ActiveWorkbook.save
ActiveWorkbook.save
Sheets("Groz-Beckert order kNITING").Select
ActiveWorkbook.save
End Sub
Bookmarks