Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Product: Excel-97 SR2
What I'm trying to achieve is within a VB script is changing the text title of a Chart. In reading through the on-line help file, it gives the following example: With Worksheets(1).Charts("chart1").Axes(xlCategory) .HasTitle = True .AxisTitle.Caption = "1994" End With But when I cut-n-paste the example into my spreadsheet, changing only the value for Worksheets and Charts to whats appropriate to my spreadsheet (for example; Worksheets ("Sheet1").Charts("Chart 3")...) I get the following error message: - Andrew Run-time error: 438 Object doesn't support property or method I've checked, double-checked, quadtriple checked for typing / syntax errors, but other than the changes mentioned, it's exactly as in the help file! Unless the help file example is wrong, I cannot find why am I getting this error. |
#2
![]() |
|||
|
|||
![]()
Hi Andrew,
Try: Sub Yester() With Worksheets("Sheet1").ChartObjects("Chart 3").Chart.Axes(xlCategory) .HasTitle = True .AxisTitle.Caption = "1994" End With End Sub --- Regards, Norman "Andrew" wrote in message ... Product: Excel-97 SR2 What I'm trying to achieve is within a VB script is changing the text title of a Chart. In reading through the on-line help file, it gives the following example: But when I cut-n-paste the example into my spreadsheet, changing only the value for Worksheets and Charts to whats appropriate to my spreadsheet (for example; Worksheets ("Sheet1").Charts("Chart 3")...) I get the following error message: - Andrew Run-time error: 438 Object doesn't support property or method I've checked, double-checked, quadtriple checked for typing / syntax errors, but other than the changes mentioned, it's exactly as in the help file! Unless the help file example is wrong, I cannot find why am I getting this error. |
#3
![]() |
|||
|
|||
![]()
Bingo! That worked. Nice of Microsoft to omit that
little piece of the puzzle! :) Thanks Norman. -----Original Message----- Hi Andrew, Try: Sub Yester() With Worksheets("Sheet1").ChartObjects("Chart 3").Chart.Axes(xlCategory) .HasTitle = True .AxisTitle.Caption = "1994" End With End Sub --- Regards, Norman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
How do I isolate my Excel server (automation) from other Excel instances? | Excel Discussion (Misc queries) | |||
sharing/using/saving Excel 2002 files in Excel 2003 | Excel Discussion (Misc queries) | |||
Excel 2002 and 2000 co-install. Control Which Starts ? | Excel Discussion (Misc queries) | |||
VB Automation is Whacking out my Excel Environment | Excel Discussion (Misc queries) |