Results 1 to 2 of 2

Thread: OLE chart window sizable with form

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2014
    Posts
    12

    OLE chart window sizable with form

    Hi all,
    this is the situation: I have a OLE chart window which contains an excel chart. This OLE is in a form which I set sizable. When the program plots the chart I would like to expand both the form and the OLE together (I mean, I want to expand the chart).
    I tried to use this code:


    Private Sub Form_Resize()
    OLE.width = Form.width
    OLE.height =Form.height
    End Sub


    but it does not work.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: OLE chart window sizable with form

    Code:
    Private Sub Form_Resize()
        On Error GoTo ExitRoutine
        If Me.WindowState <> vbMinimized Then
            With OLE1
                .Move .Left, .Top, Me.ScaleWidth, Me.ScaleHeight
                .SizeMode = vbOLESizeZoom
            End With
        End If
    ExitRoutine:
    End Sub
    There are 4 vbOLESize[xxx] constants. Try each one out
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

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



Click Here to Expand Forum to Full Width