LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default How to determine if a chart is embedded or not

Hi guys,

a question for you Excel VBA experts. I wrote the following function
which applies formatting to a chart:

Function FormatAxes(Optional SheetName As String, Optional ChartName
As String, _
Optional IsEmbedded As Boolean, _
Optional Xmin, Optional Xmax, Optional Ymin, Optional Ymax, Optional
XMinorUnit, _
Optional XMajorUnit, Optional YMinorUnit, Optional YMajorUnit)

Dim xlChart As Chart


If SheetName = vbNullString Then SheetName = ActiveSheet.Name

If ChartName = vbNullString Then ChartName = ActiveChart.Name

If IsEmbedded Then
Set xlChart = Worksheets(SheetName).ChartObjects
(ChartName).Chart
Else
Set xlChart = Charts(ChartName)
End If

....

End Function

As you can see, i tried to wrote it in such a way that the code would
work also if the sheet name and chart name are not given in input: in
that case, the code usese the active sheet and active chart. Then I
realized that such a code would work only on embedded charts, so I
added the IsEmbedded optional parameter, which tells the code if the
chart is embedded or not. However, I'd really prefer the code to
determine by itself if the chart is embedded or not, rather than
relying on the user to supply the correct value for the IsEmbedded
optional parameter. Could you please help me do this? Thank you very
much,

Best Regards

Sergio Rossi

ps if anybody is interested in the full code of the function, and/or
its goal, feel free to ask :)
 
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
Extracting chart title from Embedded Excel Chart in PowerPoint Barb Reinhardt Excel Programming 1 June 11th 08 02:22 PM
Embedded Chart Versus Chart - ShowDetail Issue [email protected] Charts and Charting in Excel 1 May 14th 06 04:11 PM
enabling chart events for an embedded chart Wazooli Excel Programming 2 January 26th 06 01:15 PM
what is the difference between embedded chart and chart-in-a-sheet dhruv Excel Programming 1 January 18th 06 03:35 PM
Determine if there's data in embedded word document Bonnie Booy Excel Programming 0 December 9th 03 07:27 PM


All times are GMT +1. The time now is 09:01 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"