Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default Can not get Excel macros to save chart format -lost in space!

Thank you very much Ed! I will try out what you mean as well.

--
mfg2529


"Ed Ferrero" wrote:

Hi,

There is a difference in VBA between a Chart and a ChartObject. The latter
is a sort of container for a Chart and can be embedded in a Worksheet.

ActiveChart is a property of the ChartObject and is read-only.
You can't write something like Set ActiveChart = MyObject.

To use the Chart name instead of the index, find out what the chart name is
(Ctrl-Click on the embedded chart and read the name of the Chart Object at
the top left). Then enclose it in double-quotes in your code. Usually
something like
..ChartObjects("Chart 1") not .ChartObjects(Chart1)

Try running this bit of code to understand what is going on;

Option Explicit ' good idea to always put this before any of your
code

Sub tst()
Dim cht As Chart
Dim oCht As ChartObject

Set oCht = ActiveSheet.ChartObjects("Chart 1")
Set cht = ActiveSheet.ChartObjects("Chart 1").Chart

Debug.Print oCht.Name, cht.Name

' you can activate the ChartObject , you can't activate the chart
oCht.Activate

End Sub

Ed Ferrero
www.edferrero.com


.

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 can I save a 40meg 26,000 row file to Space Delimited format Thanks - KVH Excel Discussion (Misc queries) 1 October 31st 08 04:56 PM
How can I save an excel 2007 chart in a vector graphics format? Kit Neel Charts and Charting in Excel 1 May 13th 08 12:34 AM
Lost columns in formated text (space delimited) save Jeff Clark Excel Worksheet Functions 10 March 17th 08 04:45 PM
How can I save an excel chart in gif format? Dom Charts and Charting in Excel 2 May 31st 05 02:03 PM
Excel save as htm with functionality too much white space AshleyT Excel Discussion (Misc queries) 0 April 26th 05 02:26 AM


All times are GMT +1. The time now is 09:39 AM.

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"