Hi There,

I am working on a script to export two separate worksheets to separate PDF files in a specific folder, with the file name as a cell referecen on the active sheet for the first printout and the filename of the "next" worksheet as the same filename with _Lab added to the file name.

Part 1 is working perfectly:

 Sub ExportPDF()
    With ActiveSheet
        .ExportAsFixedFormat 0, Environ("USERPROFILE") & "\Pictures\current month\" & _
            .Range("D11") & ".pdf", OpenAfterPublish:=True
    End With
End Sub
Part 2 is working perfectly to add the _Lab component still on the active sheet:

Sub ExportLABPDF()
    With ActiveSheet
        .ExportAsFixedFormat 0, Environ("USERPROFILE") & "\Pictures\current month\" & _
            .Range("D11") & "_Lab.pdf", OpenAfterPublish:=True
    End With

End Sub
When I try to have it move to the next worksheet, add the _Lab but still refer back to the previous worksheet for the file name beginning, i get errors:

Sub ExportLABPDF()
    Worksheets(ActiveSheet.Index + 1).Select
        .ExportAsFixedFormat 0, Environ("USERPROFILE") & "\Pictures\current month\" & _
            .Range("Template!D11") & "_Lab.pdf", OpenAfterPublish:=True
    End With

End Sub
What am I doing wrong?
Les