+ Reply to Thread
Results 1 to 2 of 2

Want to resize the embedded chart image as per the space allocated for image on userform

  1. #1
    Registered User
    Join Date
    07-13-2016
    Location
    Kolkata
    MS-Off Ver
    2016
    Posts
    1

    Want to resize the embedded chart image as per the space allocated for image on userform

    Hi,
    i have used the image embed option to embed a chart as image on user form.
    i want to resize the chart as per the space allocated for image.

    the code below generates the chart but am unable to find option to resize the same
    Kindly help.

    Private Sub frmSourcing_Click()

    Dim cht As Object
    Dim rng As Range
    Dim chtName As String
    Dim imageName As String
    Sheets("Sourcing_Count").Select
    Set rng = Sheets("Sourcing_Count").Range("h5:al5")
    'Set chtName = "Test"
    Set cht = ActiveSheet.Shapes.AddChart(xlColumnClustered).Chart
    ' MsgBox cht


    'cht.SeriesCollection.NewSeries
    cht.SeriesCollection(1).Name = "Sourcing Trend"
    MsgBox cht.SeriesCollection(1).Name
    cht.SeriesCollection(1).Values = rng
    imageName = Application.DefaultFilePath & Application.PathSeparator & "TempChart.gif"
    cht.Export Filename:=imageName
    ActiveSheet.ChartObjects(1).Delete
    frmPanIndia.imgChartDisplay.Picture = LoadPicture(imageName)

    End Sub

  2. #2
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373

    Re: Want to resize the embedded chart image as per the space allocated for image on userfo

    Hi

    In the Image control do you have the picturesizemode set to zoom?

+ 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. [SOLVED] Using a Userform to Browse image file then paste selected image to sheet?
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2015, 05:42 PM
  2. How do I Resize image with userform
    By RincewindWIZZ in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-26-2015, 06:12 PM
  3. [SOLVED] How to apply Image borders to an image that my excel vba userform pastes in a word doc?
    By CaptainCool in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2014, 05:40 PM
  4. Replies: 0
    Last Post: 11-09-2013, 02:40 AM
  5. [SOLVED] VBA to send embedded image in email body- NOT USING THE ORGINAL IMAGE SOURCE
    By Coreyusa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-27-2013, 06:48 PM
  6. resize userform image to fit on any monitor
    By timspier in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2006, 01:50 AM
  7. Userform Image Control and embedded images
    By tim in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-05-2005, 09:06 AM

Tags for this Thread

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