dwilson38550m
Board Regular
- Joined
- Nov 21, 2005
- Messages
- 89
Hi,
I have created a macro code to create a .pdf file (Review and Review History tabs) but I would also like to create a code to open this file up. Unfortunately, I have had little success opening the pdf file up. Could anyone suggest anything, please? If possible I would like to open the .pdf file with the location noted on cell S1 of Sheet1.
Thanks in advance.
I have created a macro code to create a .pdf file (Review and Review History tabs) but I would also like to create a code to open this file up. Unfortunately, I have had little success opening the pdf file up. Could anyone suggest anything, please? If possible I would like to open the .pdf file with the location noted on cell S1 of Sheet1.
Thanks in advance.
VBA Code:
Sub convertpdf()
'
' convertpdf Macro
'
Dim future As String
Dim future5 As String
Sheets("Review").Activate
Sheets(Array("Review", "Review History")).Select
ActiveWindow.ActivateNext
Sheets("Data Sheet").Select
Range("S1").Select
future5 = ActiveCell
continue: ActiveWindow.ActivateNext
Application.DisplayAlerts = False
Rem ActiveWorkbook.Close SaveChanges:=FALSE
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=future5
Application.DisplayAlerts = True
ActiveWorkbook.Close SaveChanges:=False
Sheets("data sheet").Select
Range("A1").Select
'
End Sub
Sub openpdf()
'
' openpdf Macro
'
Dim strFilename As String
strFilename = "P:\Co3\04\Contract Review - 427078.pdf"
Call Shell(strFilename, vbNormalFocus)
'
End Sub
Last edited by a moderator: