PC Review


Reply
Thread Tools Rate Thread

Chart .Location failures

 
 
=?Utf-8?B?RGF2ZSBCb29rZXI=?=
Guest
Posts: n/a
 
      12th Jul 2007
I am unable to set the Location of a ChartObject using Excel 2003, VB 6.3.

The following code will return either Error 1004 or Run-time error '438':
Object doesn't support this property or method.

ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Test"

However ActiveChart seems to be valid because immediately before (or after
if the .Location line is commented out) other properties can be changed, e.g.:

ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = 0.6

 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      12th Jul 2007
As a guess, you already have a chart sheet named "Test".
If so you'll need to rename that one, or delete it, or apply a different
name for your new chart sheet.

Regards,
Peter T

"Dave Booker" <(E-Mail Removed)> wrote in message
news:040568AA-80E3-4F19-AB81-(E-Mail Removed)...
> I am unable to set the Location of a ChartObject using Excel 2003, VB 6.3.
>
> The following code will return either Error 1004 or Run-time error '438':
> Object doesn't support this property or method.
>
> ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Test"
>
> However ActiveChart seems to be valid because immediately before (or after
> if the .Location line is commented out) other properties can be changed,

e.g.:
>
> ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = 0.6
>



 
Reply With Quote
 
=?Utf-8?B?RGF2ZSBCb29rZXI=?=
Guest
Posts: n/a
 
      12th Jul 2007
Nope... no objects named "Test" in the workbook.

"Peter T" wrote:

> As a guess, you already have a chart sheet named "Test".
> If so you'll need to rename that one, or delete it, or apply a different
> name for your new chart sheet.
>
> Regards,
> Peter T
>
> "Dave Booker" <(E-Mail Removed)> wrote in message
> news:040568AA-80E3-4F19-AB81-(E-Mail Removed)...
> > I am unable to set the Location of a ChartObject using Excel 2003, VB 6.3.
> >
> > The following code will return either Error 1004 or Run-time error '438':
> > Object doesn't support this property or method.
> >
> > ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Test"
> >
> > However ActiveChart seems to be valid because immediately before (or after
> > if the .Location line is commented out) other properties can be changed,

> e.g.:
> >
> > ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = 0.6
> >

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      12th Jul 2007
Manually select your chart, just to be sure, and in your code change
Name:="Test"
to
Name:="UniqueName"

Regards,
Peter T


"Dave Booker" <(E-Mail Removed)> wrote in message
news:94F2534B-8B0D-4A8F-A1D3-(E-Mail Removed)...
> Nope... no objects named "Test" in the workbook.
>
> "Peter T" wrote:
>
> > As a guess, you already have a chart sheet named "Test".
> > If so you'll need to rename that one, or delete it, or apply a different
> > name for your new chart sheet.
> >
> > Regards,
> > Peter T
> >
> > "Dave Booker" <(E-Mail Removed)> wrote in message
> > news:040568AA-80E3-4F19-AB81-(E-Mail Removed)...
> > > I am unable to set the Location of a ChartObject using Excel 2003, VB

6.3.
> > >
> > > The following code will return either Error 1004 or Run-time error

'438':
> > > Object doesn't support this property or method.
> > >
> > > ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Test"
> > >
> > > However ActiveChart seems to be valid because immediately before (or

after
> > > if the .Location line is commented out) other properties can be

changed,
> > e.g.:
> > >
> > > ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = 0.6
> > >

> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?RGF2ZSBCb29rZXI=?=
Guest
Posts: n/a
 
      12th Jul 2007
Tried that -- single-line macro that just calls the .Location method with
Where:=xlLocationAsNewSheet, Name:="UniqueName"

That still fails with error 438.

"Peter T" wrote:

> Manually select your chart, just to be sure, and in your code change
> Name:="Test"
> to
> Name:="UniqueName"
>
> Regards,
> Peter T
>
>
> "Dave Booker" <(E-Mail Removed)> wrote in message
> news:94F2534B-8B0D-4A8F-A1D3-(E-Mail Removed)...
> > Nope... no objects named "Test" in the workbook.
> >
> > "Peter T" wrote:
> >
> > > As a guess, you already have a chart sheet named "Test".
> > > If so you'll need to rename that one, or delete it, or apply a different
> > > name for your new chart sheet.
> > >
> > > Regards,
> > > Peter T
> > >
> > > "Dave Booker" <(E-Mail Removed)> wrote in message
> > > news:040568AA-80E3-4F19-AB81-(E-Mail Removed)...
> > > > I am unable to set the Location of a ChartObject using Excel 2003, VB

> 6.3.
> > > >
> > > > The following code will return either Error 1004 or Run-time error

> '438':
> > > > Object doesn't support this property or method.
> > > >
> > > > ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Test"
> > > >
> > > > However ActiveChart seems to be valid because immediately before (or

> after
> > > > if the .Location line is commented out) other properties can be

> changed,
> > > e.g.:
> > > >
> > > > ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = 0.6
> > > >
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      12th Jul 2007
Then I'm out of ideas. Your original code is fine, subject an active chart
exists and no similarly named chart-sheet exists.

Regards,
Peter T

"Dave Booker" <(E-Mail Removed)> wrote in message
news:151EEC18-EADD-4EDA-BBA7-(E-Mail Removed)...
> Tried that -- single-line macro that just calls the .Location method with
> Where:=xlLocationAsNewSheet, Name:="UniqueName"
>
> That still fails with error 438.
>
> "Peter T" wrote:
>
> > Manually select your chart, just to be sure, and in your code change
> > Name:="Test"
> > to
> > Name:="UniqueName"
> >
> > Regards,
> > Peter T
> >
> >
> > "Dave Booker" <(E-Mail Removed)> wrote in message
> > news:94F2534B-8B0D-4A8F-A1D3-(E-Mail Removed)...
> > > Nope... no objects named "Test" in the workbook.
> > >
> > > "Peter T" wrote:
> > >
> > > > As a guess, you already have a chart sheet named "Test".
> > > > If so you'll need to rename that one, or delete it, or apply a

different
> > > > name for your new chart sheet.
> > > >
> > > > Regards,
> > > > Peter T
> > > >
> > > > "Dave Booker" <(E-Mail Removed)> wrote in message
> > > > news:040568AA-80E3-4F19-AB81-(E-Mail Removed)...
> > > > > I am unable to set the Location of a ChartObject using Excel 2003,

VB
> > 6.3.
> > > > >
> > > > > The following code will return either Error 1004 or Run-time error

> > '438':
> > > > > Object doesn't support this property or method.
> > > > >
> > > > > ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Test"
> > > > >
> > > > > However ActiveChart seems to be valid because immediately before

(or
> > after
> > > > > if the .Location line is commented out) other properties can be

> > changed,
> > > > e.g.:
> > > > >
> > > > > ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = 0.6
> > > > >
> > > >
> > > >
> > > >

> >
> >
> >



 
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
Chart on a worksheet, find chart location headly Microsoft Excel Programming 4 20th Feb 2010 12:28 AM
Blank windows/Print failures/Search failures Ian Windows XP Internet Explorer 5 21st Jun 2009 10:17 PM
How to specify location for chart in VBA Fred Smith Microsoft Excel Misc 1 27th Feb 2008 01:50 PM
Can a text box on a chart be locked to an X-Y coordinate location on the chart? THOMAS CONLON Microsoft Excel Discussion 1 3rd Jun 2006 10:04 PM
Chart Location Broxterman Microsoft Excel Charting 1 8th Mar 2004 09:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:35 PM.