Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default can't activate chart

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 =???

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default can't activate chart

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.



" 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
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
Activate Chart Buttons TJ Charts and Charting in Excel 1 August 20th 09 03:06 AM
Cannot Activate Chart Area in Chart. Chart Object Failed [email protected] Excel Programming 2 August 8th 06 02:38 AM
Can't activate chart Michael Smith Excel Programming 1 January 20th 06 07:36 PM
De-activate a chart daniel chen Excel Discussion (Misc queries) 6 April 24th 05 05:01 AM
Activate Chart Bill[_24_] Excel Programming 2 April 25th 04 05:52 PM


All times are GMT +1. The time now is 08:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"