Hi all,
I am getting a debug error with the red text below.
I am unsure why there is an issue with this, any ideas?
Many thanks,
I am getting a debug error with the red text below.
I am unsure why there is an issue with this, any ideas?
Many thanks,
Code:
Sub SaveAsClosed()
Dim fName As String
Dim sLoc As String 'location
sLoc = "I:\FST\Quality\Non-Conformance\Non-Conformance Reports\Open\Closed\"
' Select both sheets to export into PDF file
Sheets(Array("NCR", "RCA")).Select
With ActiveSheet
fName = .Range("L4").Value & "C" & "-" & .Range("E6").Value
'Save as xlsm
[COLOR=#ff0000] ActiveWorkbook.SaveAs Filename:=sLoc & fName, FileFormat:=xlOpenXMLWorkbookMacroEnabled[/COLOR]
' Export to the PDF
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
sLoc & fName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
' Unselect the group (select only one sheet)
.Select
End With
sLoc = "I:\FST\Quality\Non-Conformance\Non-Conformance Reports\Customer Copy Non-Conformance Report\"
' Select both sheets to export into PDF file
Sheets(Array("CUSTOMER COPY")).Select
With ActiveSheet
fName = .Range("L4").Value & "C" & "-" & .Range("E6").Value
'Save as xlsm
ActiveWorkbook.SaveAs Filename:=sLoc & fName, FileFormat:=xlOpenXMLWorkbookMacroEnabled
' Export to the PDF
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
sLoc & fName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
' Unselect the group (select only one sheet)
.Select
End With
End Sub