I have the following macro and it works good. However, If someone already ran the macro and forgot to close out the generated PDF documents and then attempts to rerun the macro I get a debug message. How do I add code prior to Saving the document to PDF to check and see if the document is already open and if open then generate a pop up message stating something like "PDF is already generated and open. Document will not save." then when they click "Ok" the code ends. Any help is apprieciated.

Sub ToPDF()
'
'
'Declaring our Variables
Dim Stamp As String
Dim WhereTo As String
Dim sFileName As String
Dim DocName As String

'Retrieving our data
Sheets("Sheet(1)").Activate
Range("o4").Activate
WhereTo = ActiveCell.Value
Range("o2").Activate
Stamp = ActiveCell.Value
If Stamp = "" Then Stamp = "An Error"
DocName = "_EMC_"

'creating file name
sFileName = WhereTo & Stamp & DocName & Format(CDate(Date), "YYYY.MM.DD") & ".pdf"


'Add to save to PDF Command
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
sFileName, Quality _
:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End If

End Sub