+ Reply to Thread
Results 1 to 6 of 6

Display PDF in Userform using HTML webbrowser control

  1. #1
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Display PDF in Userform using HTML webbrowser control

    Hi,

    I am looking for a way to display a PDF file in a userform. I came acros the sollution in the attached file but i can't get it working.
    Does anyone know what i do wrong?

    Tx!
    Attached Files Attached Files

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,906

    Re: Display PDF in Userform using HTML webbrowser control

    Try attached.

    Can't post code because of Firewall disliking Html-code but solution is to put the code in the Userform_Initialize event.
    Attached Files Attached Files
    Last edited by bakerman2; 05-14-2019 at 08:15 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Display PDF in Userform using HTML webbrowser control

    Yeah it works now. It only works when acrobat reader is already open. Is that always the case? if yes, do you know another way to display a pfd of word file in the userform?
    I can't find a better way anywhere.

    Tx

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,906

    Re: Display PDF in Userform using HTML webbrowser control

    Acrobat reader doesn't need to be open when running the userform, at least not in my case.

  5. #5
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Display PDF in Userform using HTML webbrowser control

    Ah yeah you are right. Tx for the help!
    Last edited by Afjio12; 05-15-2019 at 04:01 AM.

  6. #6
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Display PDF in Userform using HTML webbrowser control

    Hello,
    Is there a way to Embedd the file in the excel file? A path to the PDF is not the best sollution for me because if the directory structure changes the PDF path doesn't work anymore.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Display other controls ON TOP of the webbrowser control
    By EchoPassenger in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2017, 06:13 PM
  2. [SOLVED] Run a Macro from a Hyperlink in an Html file loaded in the Webbrowser on a Userform!
    By EchoPassenger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2015, 04:20 PM
  3. Problem with HTML in UserForm WebBrowser
    By jaskamakkara in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-17-2014, 01:56 AM
  4. Getting html document of a webbrowser/SHDocVw.InternetExplorer control's tab
    By david90 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2013, 06:23 PM
  5. Replies: 1
    Last Post: 05-04-2012, 06:03 AM
  6. How to make WebBrowser control display different HTML files on subsequent macro runs
    By VTHokie11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2012, 09:34 AM
  7. userform webbrowser to preview HTML code.
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2009, 01:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1