ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying a chart to a user form (https://www.excelbanter.com/excel-programming/363014-copying-chart-user-form.html)

[email protected]

Copying a chart to a user form
 
Hello i am trying to copy a chart to a user form using :

Private Sub cmdagecharts_Click()
Dim chtchart As Chart
Dim image

Set chtchart = Sheet9.ChartObjects(1).Chart
image = chtchart.CopyPicture(xlScreen, xlPicture)
Set imgchtpic1.Picture = pastePicture(image)


End Sub

each time i run it this bit of code i get the error message Expected
Function or Variable

Your help is despirately needed
Many thanks


Jon Peltier

Copying a chart to a user form
 
What are you using for PastePicture?

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


wrote in message
oups.com...
Hello i am trying to copy a chart to a user form using :

Private Sub cmdagecharts_Click()
Dim chtchart As Chart
Dim image

Set chtchart = Sheet9.ChartObjects(1).Chart
image = chtchart.CopyPicture(xlScreen, xlPicture)
Set imgchtpic1.Picture = pastePicture(image)


End Sub

each time i run it this bit of code i get the error message Expected
Function or Variable

Your help is despirately needed
Many thanks





All times are GMT +1. The time now is 10:59 PM.

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