#1   Report Post  
Stevie D
 
Posts: n/a
Default Save excel chart

Hi I have two related questions,

1) Is it possible to select an excel chart and save it as a separate object
that is that independent of the workbook it was created in?

2) Assuming this can be done - can I use VBA to overwrite this file when the
underlying data source changes?

Thanks,

Steve


  #4   Report Post  
crossingmind
 
Posts: n/a
Default

Hi Don, I got this question after reading your help. Do you think it
is possible to save charts to illustrator file format as a seperate
file? Thank you in advance!

  #5   Report Post  
Don Guillett
 
Posts: n/a
Default

try it. Just change the extensions.

--
Don Guillett
SalesAid Software

"crossingmind" wrote in message
oups.com...
Hi Don, I got this question after reading your help. Do you think it
is possible to save charts to illustrator file format as a seperate
file? Thank you in advance!





  #6   Report Post  
crossingmind
 
Posts: n/a
Default

Sub ExportChartAI()
ActiveChart.Export Filename:="C:\a\MyChart.ai", _
FilterName:="ai"
End Sub

Hi Don, thanks for your reply. I tried this code, but it kept telling
me

ActiveChart.Export Filename:="C:\a\MyChart.ai", _
FilterName:="ai"

needs debug. Could you help take a look? Thank you again!

  #7   Report Post  
 
Posts: n/a
Default

Hi -

1) Yes. This takes a moment to explain, but it's doable.

In this code snippet, we have a ChartArchiveBook that simply holds a
large number of charts in WMF/EMF format. It assumes that you have
already selected the chart.

With ActiveChart
.ChartArea.Select
.CopyPicture Appearance:=xlPrinter, Size:=xlScreen,
Format:=xlPicture
End With
'
' First name the graph so we can find it again, and put it where we
can see it...
'
GraphName = "WhateverYouWantItToBe"

' The following pastes to the proper format and to the proper place.
You can fiddle with the range...
'
With Workbooks(IndustryAnalyseBook).Sheets(AnalyseBookS heetName)
.Activate
.Range("A1").Select
.PasteSpecial Format:="Bild (Extended Metafile)",
Link:=False, _ DisplayAsIcon:=False
End With
With Selection.ShapeRange
.Parent.Name = GraphName
.Height = 500
.Width = 232
End With

The latter code simply places it in cell A1 and gives it the size of
500 by 232 pixels, you'll want to change that.

2) This took a long time to figure out, but it works great:

For Each MyShape In
Workbooks("TargetWorkbook").Sheets("TargetWorkshee t").Shapes
If MyShape.Name = GraphName Then MyShape.Delete
Next MyShape

These code snippets are part of a very large system, so they might not
be completely understandable: let me know if you need further
explanation...

John

PS: some of the code wraps funny here...you'll need to play with it to
get it working right...

  #8   Report Post  
 
Posts: n/a
Default

Darn, forgot to neutralize this code:

With Workbooks("TargetWorkbook").Sheets("TargetWorkshee t")
.Activate
.Range("A1").Select
.PasteSpecial Format:="Bild (Extended Metafile)",
Link:=False, _ DisplayAsIcon:=False
End With
With Selection.ShapeRange
.Parent.Name = GraphName
.Height = 500
.Width = 232
End With

So, now that should be clearer...

John

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the color of all series in an excel chart in one go. Marielle Charts and Charting in Excel 2 May 3rd 23 07:45 PM
Missing values in Excel Line Chart mw55309 Charts and Charting in Excel 1 January 19th 05 12:10 PM
how to let excel ask to save the sheet when closing the excel file Malek Setting up and Configuration of Excel 1 January 4th 05 12:13 AM
BUG?: Excel scatter chart: will not plot x-values Bob Excel Discussion (Misc queries) 2 December 31st 04 12:19 AM
Save Excel file - prompts to save - no Volitile functions used POWER CERTS Excel Worksheet Functions 2 November 1st 04 09:27 PM


All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"