ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I change size of the picture without changing chartobject? (https://www.excelbanter.com/excel-programming/318349-how-can-i-change-size-picture-without-changing-chartobject.html)

Marie J-son[_4_]

How can I change size of the picture without changing chartobject?
 
Hi there,

I have this code in a userform and get with it a picture in the same size as
the chartobject - to small. I want a much larger (fill the screen as much as
possible). I can easily solve it by changing size of the chartobject before
export to gif, but i dno't want to do that. I want to change the size of the
gif during or after importing it by LoadPicture.

How?

Help = Forever happy

/Regards

Dim ChartNum As Integer

Private Sub UserForm_Initialize()
Debug.Print "frmPPT initilize "
ChartNum = 1
UpdateChart
End Sub

Private Sub UpdateChart()
Set CurrentChart = Blad102.ChartObjects(ChartNum).Chart

' Save chart as GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.GIF"
CurrentChart.Export Filename:=Fname, FilterName:="GIF"

' Show the chart
Image1.Picture = LoadPicture(Fname)

End Sub




Jon Peltier[_9_]

How can I change size of the picture without changing chartobject?
 
See answer in excel.charting group.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Marie J-son wrote:

Hi there,

I have this code in a userform and get with it a picture in the same size as
the chartobject - to small. I want a much larger (fill the screen as much as
possible). I can easily solve it by changing size of the chartobject before
export to gif, but i dno't want to do that. I want to change the size of the
gif during or after importing it by LoadPicture.

How?

Help = Forever happy

/Regards

Dim ChartNum As Integer

Private Sub UserForm_Initialize()
Debug.Print "frmPPT initilize "
ChartNum = 1
UpdateChart
End Sub

Private Sub UpdateChart()
Set CurrentChart = Blad102.ChartObjects(ChartNum).Chart

' Save chart as GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.GIF"
CurrentChart.Export Filename:=Fname, FilterName:="GIF"

' Show the chart
Image1.Picture = LoadPicture(Fname)

End Sub






All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com