PC Review


Reply
Thread Tools Rate Thread

can't activate chart

 
 
matthias.rother@gmail.com
Guest
Posts: n/a
 
      15th Sep 2007
hi,

i have a public sub "gen_chart" with the following parameter value
( myobject as object,mychart as chart)


when i call this sub from a form he stops at the following line
("cur_sheets.ChartObjects(cur_chart).Activate")

text = object not set

Private Sub gen_foto(cur_sheets As Object, cur_chart As String, name
As String, _
min_x As Single, max_x As Single, min_y As
Single,
_
max_y As Single, position As Integer, show_legend
As Boolean, change_color As Boolean, _
colls() As Variant, Optional name_x As String,
Optional name_y As String)


'cur_sheets As String --> Names des Sheets
'cur_chart As String --> Name des Charts
'name as string --> Charttopic
'min_x As Single --> MIN X-Achse
'max_x As Single --> MAX X-Achse
'min_y As Single --> MIN Y-Achse
'max_y As Single --> MAX Y-Achse
'position as integer --> 0 (großes foto),1=zielfoto(links_oben),
2=zielfoto(rechts_oben),3=zielfoto(links_unten),
4=zielfoto(rechts_unten)
'show_legend as boolean --> Show Legend ?
'change_color as boolean --> change background color to orange
'colls() as variant --> Datenreihe (1.dimension = reihe(1-3) |
2.dimension = 0(name),1(x_wert1),2(y_wert1),3(x_wert2),4(y_wert2)


'Optional name_x As String --> Name X-Achse
'Optional name_y As String --> name Y-Achse


cur_sheets.ChartObjects(cur_chart).Activate


On Error Resume Next
'del all collections
Dim del_i As Integer
For del_i = 0 To 20
ActiveChart.SeriesCollection(1).Delete
Next del_i


ActiveChart.ChartType = xlXYScatter


ActiveChart.ChartArea.Select
Selection.AutoScaleFont = False
With Selection.Font
.name = "Arial"
.FontStyle = "fett"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
..
..
..
..


can anybody help me =???

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      15th Sep 2007
It is trying to tell you that you have not defined the cur_sheet, or
cur_chart objects.

You need a statement like:

Set cur_sheet = Worksheets("Sheet1")
Set cur_chart = Sheets("Chart1")

changing the names of the sheets to your actual sheet names, of course.



"(E-Mail Removed)" wrote:

> hi,
>
> i have a public sub "gen_chart" with the following parameter value
> ( myobject as object,mychart as chart)
>
>
> when i call this sub from a form he stops at the following line
> ("cur_sheets.ChartObjects(cur_chart).Activate")
>
> text = object not set
>
> Private Sub gen_foto(cur_sheets As Object, cur_chart As String, name
> As String, _
> min_x As Single, max_x As Single, min_y As
> Single,
> _
> max_y As Single, position As Integer, show_legend
> As Boolean, change_color As Boolean, _
> colls() As Variant, Optional name_x As String,
> Optional name_y As String)
>
>
> 'cur_sheets As String --> Names des Sheets
> 'cur_chart As String --> Name des Charts
> 'name as string --> Charttopic
> 'min_x As Single --> MIN X-Achse
> 'max_x As Single --> MAX X-Achse
> 'min_y As Single --> MIN Y-Achse
> 'max_y As Single --> MAX Y-Achse
> 'position as integer --> 0 (großes foto),1=zielfoto(links_oben),
> 2=zielfoto(rechts_oben),3=zielfoto(links_unten),
> 4=zielfoto(rechts_unten)
> 'show_legend as boolean --> Show Legend ?
> 'change_color as boolean --> change background color to orange
> 'colls() as variant --> Datenreihe (1.dimension = reihe(1-3) |
> 2.dimension = 0(name),1(x_wert1),2(y_wert1),3(x_wert2),4(y_wert2)
>
>
> 'Optional name_x As String --> Name X-Achse
> 'Optional name_y As String --> name Y-Achse
>
>
> cur_sheets.ChartObjects(cur_chart).Activate
>
>
> On Error Resume Next
> 'del all collections
> Dim del_i As Integer
> For del_i = 0 To 20
> ActiveChart.SeriesCollection(1).Delete
> Next del_i
>
>
> ActiveChart.ChartType = xlXYScatter
>
>
> ActiveChart.ChartArea.Select
> Selection.AutoScaleFont = False
> With Selection.Font
> .name = "Arial"
> .FontStyle = "fett"
> .Size = 10
> .Strikethrough = False
> .Superscript = False
> .Subscript = False
> .OutlineFont = False
> .Shadow = False
> .Underline = xlUnderlineStyleNone
> .ColorIndex = xlAutomatic
> .Background = xlAutomatic
> End With
> ..
> ..
> ..
> ..
>
>
> can anybody help me =???
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot Activate Chart Area in Chart. Chart Object Failed ahperez@gmail.com Microsoft Excel Programming 2 8th Aug 2006 02:38 AM
Cannot activate a chart on a sheet =?Utf-8?B?RmFyb29xIFNoZXJp?= Microsoft Excel Programming 7 27th Jul 2006 08:56 AM
Can't activate chart Michael Smith Microsoft Excel Programming 1 20th Jan 2006 07:36 PM
De-activate a chart daniel chen Microsoft Excel Misc 6 24th Apr 2005 05:01 AM
Activate Chart Bill Microsoft Excel Programming 2 25th Apr 2004 05:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:28 PM.