![]() |
|
#1
|
|||
|
|||
|
Hello All,
So I have what seems to be an insanely easy coding question, but it's driving me crazy. So I have this code that selects a chart and then copies it, and I wanted to make it save the chart as a picture instead of copying it. Here is the copying code: Code:
Dim objChart As ChartObject
On Error Resume Next
Set objChart = ActiveSheet.ChartObjects(1).Select
Selection.CopyPicture _
Appearance:=xlScreen, Format:=xlBitmap
Code:
Dim objChart As ChartObject
On Error Resume Next
Set objChart = ActiveSheet.ChartObjects(1).Select
Selection.Export Filename:="C:\test.jpg", FilterName:="jpg"
Code:
Dim objChart As ChartObject
Dim slcChart As ChartObject
On Error Resume Next
Set objChart = ActiveSheet.ChartObjects(1).Select
Set slcChart = ActiveSheet.ChartObjects(1)
If ActiveChart Is Nothing Then
MsgBox "No charts have been detected on this sheet", 0
End If
slcChart.Export Filename:="C:\test.jpg", FilterName:="jpg"
-Dave |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VBA code to group picture to export as one | RenaatS | PowerPoint | 3 | 03-05-2012 12:40 PM |
| Export resource custom field to excel chart | jtorres | Project | 0 | 03-15-2011 05:16 AM |
| Can't select or edit chart data | itguy | PowerPoint | 2 | 09-19-2010 10:13 AM |
| Making a bar chart with several data entries | Blondie1966 | PowerPoint | 2 | 04-28-2010 03:00 PM |
| How To Export A Picture From Word? | abrogard | Drawing and Graphics | 0 | 08-10-2009 06:27 PM |