PC Review


Reply
Thread Tools Rate Thread

Chart position newbie question

 
 
Keith Wilby
Guest
Posts: n/a
 
      2nd Apr 2007
What syntax do I need to position the active chart in a certain position on
a worksheet? I'm doing this from MS Access, here's a code snippet:

With objXL.ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "My Title"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Week No"
.Axes(xlValue, xlPrimary).HasTitle = False
End with

This all works nicely but I want to put the chart at certain coordinates on
the sheet. Any clues?

Many thanks.

Keith.


 
Reply With Quote
 
 
 
 
Mike Fogleman
Guest
Posts: n/a
 
      2nd Apr 2007
The Top property can be set to a certain row and the Left property can be
set to a certain column.
With objXL.ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "My Title"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Week No"
.Axes(xlValue, xlPrimary).HasTitle = False
.Left = .Columns("B").Left 'left edge of col B
.Top= .Rows(2).Top 'top of row 2
End with

Mike F
"Keith Wilby" <(E-Mail Removed)> wrote in message
news:4610fad6$(E-Mail Removed)...
> What syntax do I need to position the active chart in a certain position
> on a worksheet? I'm doing this from MS Access, here's a code snippet:
>
> With objXL.ActiveChart
> .HasTitle = True
> .ChartTitle.Characters.Text = "My Title"
> .Axes(xlCategory, xlPrimary).HasTitle = True
> .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
> "Week No"
> .Axes(xlValue, xlPrimary).HasTitle = False
> End with
>
> This all works nicely but I want to put the chart at certain coordinates
> on the sheet. Any clues?
>
> Many thanks.
>
> Keith.
>



 
Reply With Quote
 
Keith Wilby
Guest
Posts: n/a
 
      2nd Apr 2007
"Mike Fogleman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The Top property can be set to a certain row and the Left property can be
> set to a certain column.
> With objXL.ActiveChart
> .HasTitle = True
> .ChartTitle.Characters.Text = "My Title"
> .Axes(xlCategory, xlPrimary).HasTitle = True
> .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
> "Week No"
> .Axes(xlValue, xlPrimary).HasTitle = False
> .Left = .Columns("B").Left 'left edge of col B
> .Top= .Rows(2).Top 'top of row 2
> End with
>


Cheers Mike, just the job.

Keith.


 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      2nd Apr 2007
Except you need to position the chart object:

With objXL.ActiveChart
With .Parent
.Left = .Columns("B").Left 'left edge of col B
.Top= .Rows(2).Top 'top of row 2
End With
End with

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Mike Fogleman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The Top property can be set to a certain row and the Left property can be
> set to a certain column.
> With objXL.ActiveChart
> .HasTitle = True
> .ChartTitle.Characters.Text = "My Title"
> .Axes(xlCategory, xlPrimary).HasTitle = True
> .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
> "Week No"
> .Axes(xlValue, xlPrimary).HasTitle = False
> .Left = .Columns("B").Left 'left edge of col B
> .Top= .Rows(2).Top 'top of row 2
> End with
>
> Mike F
> "Keith Wilby" <(E-Mail Removed)> wrote in message
> news:4610fad6$(E-Mail Removed)...
>> What syntax do I need to position the active chart in a certain position
>> on a worksheet? I'm doing this from MS Access, here's a code snippet:
>>
>> With objXL.ActiveChart
>> .HasTitle = True
>> .ChartTitle.Characters.Text = "My Title"
>> .Axes(xlCategory, xlPrimary).HasTitle = True
>> .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
>> "Week No"
>> .Axes(xlValue, xlPrimary).HasTitle = False
>> End with
>>
>> This all works nicely but I want to put the chart at certain coordinates
>> on the sheet. Any clues?
>>
>> Many thanks.
>>
>> Keith.
>>

>
>



 
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
how to draw crosshairs on a chart that go to the height and width of the chart and move with the cursor position? Steve Microsoft C# .NET 1 11th Sep 2006 02:41 PM
Newbie Question - Insert Chart Compenet in Frontpage 2000 Nicola Microsoft Frontpage 4 25th Feb 2005 05:32 PM
newbie chart question retriever Microsoft Excel Charting 1 18th Nov 2004 02:41 PM
newbie chart question retriever Microsoft Excel Charting 1 14th Nov 2004 03:33 AM
newbie chart question bbxrider Microsoft Excel Charting 1 15th Jan 2004 01:00 PM


Features
 

Advertising
 

Newsgroups
 


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