P
Phil H
SITUATION: want to place a .pdf file in a UserForm so when a user clicks a
CommandButton in a worksheet, the UserForm comes up displaying the .pdf file
and the user can scroll through the pages.
WHAT’S BEEN DONE:
1. UserForm3 created.
2. Adobe AcroPDF1 control inserted/confirmed in UserForm – from Toolbox.
3. CommandButton1 inserted in worksheet.
4. The following code inserted in Module1 [thanks go to Jacob Skaria on
MSDN]:
Private Sub CommandButton1_Click()
With Me.AcroPDF1
.LoadFile "S:\.........\DTM-09-007.pdf" [the file on local
share drive]
.setShowToolbar (False)
.gotoFirstPage
End With
End Sub
RESULT: On clicking CommandButton1:
1. Error message: “Compile Error:â€
a. “Method or data member not foundâ€
b. Private Sub line yellow highlighted
c. .AcroPDF1 cited (highlighted blue)
REQUEST:
1. Resolve compile error.
2. Have the .pdf file imbedded in the Excel workbook so when the workbook
is used by others outside the local share drive (.pdf file not accessible),
the .pdf file will come up and be operable in the UserForm.
CommandButton in a worksheet, the UserForm comes up displaying the .pdf file
and the user can scroll through the pages.
WHAT’S BEEN DONE:
1. UserForm3 created.
2. Adobe AcroPDF1 control inserted/confirmed in UserForm – from Toolbox.
3. CommandButton1 inserted in worksheet.
4. The following code inserted in Module1 [thanks go to Jacob Skaria on
MSDN]:
Private Sub CommandButton1_Click()
With Me.AcroPDF1
.LoadFile "S:\.........\DTM-09-007.pdf" [the file on local
share drive]
.setShowToolbar (False)
.gotoFirstPage
End With
End Sub
RESULT: On clicking CommandButton1:
1. Error message: “Compile Error:â€
a. “Method or data member not foundâ€
b. Private Sub line yellow highlighted
c. .AcroPDF1 cited (highlighted blue)
REQUEST:
1. Resolve compile error.
2. Have the .pdf file imbedded in the Excel workbook so when the workbook
is used by others outside the local share drive (.pdf file not accessible),
the .pdf file will come up and be operable in the UserForm.