Hi everyone - I have a rather obscure problem here that someone may be able to help with although it won't surprise me if no-one knows the answer:
My goal is to have a form that displays (among other controls) a PDF document which has previously been embedded into the spreadsheet.
I can embed the PDF document in vba as follows:
where the Range PDFFile contains a filename such as C:\Myfile.PDF
I also have a form that can display a PDF document nicely using the code:
where frmMyForm is a userform and pdfMyPDF is an "Adobe PDF Reader" control. This control appears in the list of additional controls you can add when right clicking the toolbox in Visual Basic.
And so in a nutshell...
I don't want the userform to display the PDF from the external PDF file (I can already do this in any case) - I need it to display the PDF from the embedded PDF file. What code do I need to do this (-ie- to use the embedded PDF as the source for the PDF file on the userform?)
Thank you.
My goal is to have a form that displays (among other controls) a PDF document which has previously been embedded into the spreadsheet.
I can embed the PDF document in vba as follows:
Code:
ActiveSheet.OLEObjects.Add Filename:=Range("PDFFile"), DisplayAsIcon:=True
where the Range PDFFile contains a filename such as C:\Myfile.PDF
I also have a form that can display a PDF document nicely using the code:
Code:
frmMyForm.pdfMyPDF.src = Range("PDFFile")
frmMyForm.Show
where frmMyForm is a userform and pdfMyPDF is an "Adobe PDF Reader" control. This control appears in the list of additional controls you can add when right clicking the toolbox in Visual Basic.
And so in a nutshell...
I don't want the userform to display the PDF from the external PDF file (I can already do this in any case) - I need it to display the PDF from the embedded PDF file. What code do I need to do this (-ie- to use the embedded PDF as the source for the PDF file on the userform?)
Thank you.