Hi Guy's,
Windows XP
Excel 2003
this one I’m sure will have a simple solution, but for some reason I can't find one, still pretty new to vba so trying my best her, but spent best part of 5hrs on this and I’m sure I’ve prob wasted allot of time.
The code below easily displays the referenced PDF file in the PDF viewer within my userform1
***this lets me select the PDF file*****
Private Sub CommandButton2_Click()
fileToOpen = Application _
.GetOpenFilename("All xls Files (*.PDF), *.PDF")
If fileToOpen <> False Then
TextBox1.Value = fileToOpen
End If
End Sub
***this then opens the PDF file from the path that was inputted into textbox1
I’ve been trying to do the same with online PDF file (which I have the urls for) but cant get it working, I’ve had read through the related posts on hyper linking and opening them, but they all refer to hyperlinks within cells where I’m just looking to assign an address to a button that when clicked will display the linked PDF file in the viewer
Any ideas
So far I’ve tried the following without success (excuse my ignorance and level of vba knowledge if any of this code looks ridiculous)
Private Sub commandbutton4_click()
Dim linkname As Hyperlink
linkname = TextBox1.Value
AcroPDF1.LoadFile linkname
End Sub
I get runtime error '91'
object variable or with block variable not set
Help!!
Thanks in advance guy's
Gman1979
Private Sub CommandButton1_Click()
AcroPDF1.LoadFile TextBox1.Value
End Sub
Windows XP
Excel 2003
this one I’m sure will have a simple solution, but for some reason I can't find one, still pretty new to vba so trying my best her, but spent best part of 5hrs on this and I’m sure I’ve prob wasted allot of time.
The code below easily displays the referenced PDF file in the PDF viewer within my userform1
***this lets me select the PDF file*****
Private Sub CommandButton2_Click()
fileToOpen = Application _
.GetOpenFilename("All xls Files (*.PDF), *.PDF")
If fileToOpen <> False Then
TextBox1.Value = fileToOpen
End If
End Sub
***this then opens the PDF file from the path that was inputted into textbox1
I’ve been trying to do the same with online PDF file (which I have the urls for) but cant get it working, I’ve had read through the related posts on hyper linking and opening them, but they all refer to hyperlinks within cells where I’m just looking to assign an address to a button that when clicked will display the linked PDF file in the viewer
Any ideas
So far I’ve tried the following without success (excuse my ignorance and level of vba knowledge if any of this code looks ridiculous)
Private Sub commandbutton4_click()
Dim linkname As Hyperlink
linkname = TextBox1.Value
AcroPDF1.LoadFile linkname
End Sub
I get runtime error '91'
object variable or with block variable not set
Help!!
Thanks in advance guy's
Gman1979
Private Sub CommandButton1_Click()
AcroPDF1.LoadFile TextBox1.Value
End Sub