ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 4,564
- Office Version
-
- 2007
- Platform
-
- Windows
Evening,
The code in use is shown below.
I ask for it to be checked as it doesnt seem to flow smoothly also if i move the cursor away from the MsgBox i see the cursor going around & around all the time
The code in use is shown below.
I ask for it to be checked as it doesnt seem to flow smoothly also if i move the cursor away from the MsgBox i see the cursor going around & around all the time
Rich (BB code):
Private Sub Generate_Pdf_Click()
Dim sPath As String, strFileName As String
strFileName = "C:\Users\Ian\Desktop\REMOTES ETC\DR\DR SCREEN SHOT PDF\" & Range("G13").Value & ".pdf"
If Dir(strFileName) <> vbNullString Then
MsgBox "GENERATED PDF " & vbNewLine & vbNewLine & Range("G13").Value & vbNewLine & vbNewLine & "WAS NOT SAVED AS IT ALLREADY EXISTS", vbCritical + vbOKOnly, "GENERATE PDF FILE MESSAGE"
Exit Sub
End If
With ActiveSheet
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strFileName, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False
MsgBox "PDF HAS NOW BEEN SAVED", vbInformation + vbOKOnly, "GENERATE PDF FILE MESSAGE"
End With
sPath = "C:\Users\Ian\Desktop\REMOTES ETC\DR\DR SCREEN SHOT PDF\"
strFileName = sPath & Range("G13").Value & ".pdf"
If Dir(strFileName) <> vbNullString Then
ActiveWorkbook.FollowHyperlink strFileName
End If
InvoiceClearSheetQuestion.Show
End Sub