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

On 21 Gen, 18:33, "Peter T" <peter_t@discussions wrote:
[..]
Q3

The scenario is this: I call FormatAxes from other subroutines, and I
want it to work either on the active chart, or on a chart which is not
the active one.


First of all I'd make an additional procedure purely to return a chart, lets
call it GetChart, then pass the chart to the routine that formats the axes.
Function FormatAxes() is only then concerned with formatting axes, so you'd
remove all arguments other than those pertaining to the axes, but add one,
namely an object reference to the chart you are concerned with. The first
argument will be say 'cht as Chart'

[..]

You're right, of course. It occured to me yesterday, after thinking
over this thread, that maybe passing just the object reference to
FormatAxes would have been better, and I also got the same suggestion
from other sources. A good lesson in correct programming style :)


I'm not sure why Len would work, from Excel help, "[..] returns a Long
containing the number of characters in a string or the number of bytes
required to store a variable.", *so it doesn't return a Boolean.


Len(myString) returns a Long. It's an effective way to test a string, though
not the only way. A number can be coerced to a Boolean to return True (not
zero) or False (zero). So -

If Len(myString) then
* * ' we have a non zero length string
Else
*' the string is ""
End If

' could also be written
If Len(myString) = True Then
or
If Len(myString) 0 then


Ok, nice: I use IsMissing to check for Optional arguments, didn't know
that Len would work as well for string arguments.

Regards,
Peter T


Thanks for all your support,

Best Regards

Andrea
 
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:21 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"