Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OLE container: How to reduce overhead? (VB 6)

    In a Form, code like the following is in the Form's load event.

    <pre> strTemp = App.Path & "x.pdf"
    With OLE1
    .Visible = False
    .SizeMode = vbOLESizeClip
    .DisplayType = vbOLEDisplayIcon
    .AutoVerbMenu = False
    .Enabled = False
    .UpdateOptions = vbOLEManual
    .CreateLink strTemp
    End With
    </pre>


    There is a noticeable pause while the form is loading.

    Am I setting the right properties in the Load event?

    Should I move most of the setting of properties to the click event for the
    button event that has

    OLE1.DoVerb vbOLEOpen

    Other than making the control non-visible, do I need to set the other
    properties in the Form's Load event?

    The OLE control is never shown, a command button is used to open the PDF file,
    and the Updated event is used to detect that the PDF file has been closed.

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: OLE container: How to reduce overhead? (VB 6)

    Judging by how it takes Adobe Reader to open and load a PDF, I am not at all surprised that there is a delay in showing your form. Do you need the OLE control at all, or could you shell the PDF in the Reader?

  4. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OLE container: How to reduce overhead? (VB 6)

    I need to be able to detect when the PDF file is closed.
    I figured that the OLE container would be a more effective way to check this than to periodically check whether the window was still open.
    Not to mention, I do not want to have to figure out which progrAM IS reading the PDF, and HOW to monitor the windows for that program.

Posting Permissions

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