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: 11
Default Creating a new Excel chart type

Hi all,
sorry to dive straight in in my first post, but I joined up specifically
because I figured one of you would probably know how to do this and save me a
lot of messing about.
I have a fair amount of experience using VB.NET and would like to be able
to code a new type of chart in Excel (which I guess is most easily done using
VB script in Excel).

The Chart object accessible through VB script seems to be the obvious
starting place - I had imagined I would set a few simple properties (like
programatically setting the [Chart].Series.Values and [Chart].Series.XValues
propreties or pointing them to a cell range) and then call
ActiveSheet.Charts.Add method for my Chart object having overriden its Paint
method to provide the customised drawing.

Alas, no. For a start, VB script doesn't seem to really support OOP in the
same way .NET does, particularly when it comes to declaring and instantiating
a Chart object, so I've stumbled on even the first hurdle. Chart objects
can't be declared with the "new" keyword to instantiate them, so to avoid the
"object variable or with block not set" error I tried using the "set" keyword
to assign the return object from CreateObject("Excel.Chart") command to an
object variable. This seemedo far as it goes, but then every time I try to
access a property or method I get "Object does not support automation" errors
which Help tells me means that the Chart object doesn't expose the properties
and methods I want programatically (eems like a waste of time being able to
refer to it at all, if that's the case!) Maybe this is because the assignment
of the CreateObject object to an object variable using "set" is implicitly
late bound?

In any case, I want to be able to instantiate a Chart object and play with
its methods, properties and events programatically. In particular, to
override the events triggered when it redraws itself with custom code. Can
anyone help me out here?

Thanks for your time and expertise,
Heath.
 
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 DO YOU TYPE - OR + IN EXCEL WITHOUT CREATING A FORMULA? jools Excel Discussion (Misc queries) 5 September 19th 06 03:25 PM
Excel x,y chart type x range must be re-entered each series Thomas R. Glass Charts and Charting in Excel 1 February 8th 06 11:23 PM
How to prevent Excel 2003 from automatically change chart type Oscar II Charts and Charting in Excel 2 October 1st 05 02:57 PM
Excel chart type that looks like a car speedometer Club Accountant Charts and Charting in Excel 1 September 23rd 05 01:57 AM
Adding a line Chart Type to a stacked-clustered Chart Type Debbie Charts and Charting in Excel 2 January 5th 05 11:25 PM


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