Viewing PDF file within a userform

philfloyduk

Board Regular
Joined
Jan 6, 2011
Messages
82
Hi.

I have set my repair management form up to be able to view the PDF invoice that is generated when a repair is completed. When the repair is completed it generates the PDF autmatically and puts the file location in a textbox. Next to the textbox I have put a command button 'view' which has the following code to allow the user to view the PDF:

If tbViewPDF.Value = True Then
With Me.AcroPDF1
.LoadFile tbPDFFileExtension.Value
.setShowToolbar (True)
.gotoFirstPage
End With
AcroPDF1.Visible = True
Else
AcroPDF1.Visible = False
End If

This works fine.

I then copied the same method for the form I use to manage our sales, used the same textbox with the same name (copied it from the repairs form and pasted it to the sales form), and pasted the code above the the command button that... I'd copied and pasted, but it doesn't work! I've checked everything countless times to make sure there are not mistakes and it is literally identical. I don't get an error, it just doesn't display. I've tried setting the .visible to true by default and loading it that way, I've also put a specific file location in the code so it loads a particular PDF but it still doesn't display it. Does anyone have any ideas?

Any help will be much appreciated.

Thanks in advance,

Phil.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,224,604
Messages
6,179,857
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top