Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Chart Sheet/Axes

This seems like and probably is a trivial question, but I can't seem to
get it right. I've browsed through this group and found seemingly many
solutions that apply to chart objects, but not with a seperate chart
sheet im working with.

I am referencing the chart sheet via (Excel.Application).Charts(1)
like:

xlApp.Charts(1).Select

I am trying to find a simple way to read the min/max scale of the Y
axis, and if they are 0 to 1, change to 0 to 1.2. I've tried many
variations but can't seem to find one that actually works -- I also
recorded a macro to set this and it wouldnt seem to work either. Can
anyone provide a quick sample of what might be used to retrieve and/or
set the min/max scale values on a seperate chart sheet?

TIA

Pat

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Chart Sheet/Axes

BTW an example of what I'm using to try to retrieve this value would
be:

xlApp.Charts(1).Axes(xlValue).MaximumScale

TIA

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Chart Sheet/Axes

I am referencing the chart sheet via (Excel.Application).Charts(1)

try a referencing a workbook chart sheet in the Workbook's Charts or Sheets
collection

Sub test()
Dim cht As Chart

Set cht = ActiveWorkbook.Charts("Chart3")

With cht.Axes(xlValue)
'might need to set respective 'ScaleIsAuto
'.MinimumScaleIsAuto = False
'.MaximumScaleIsAuto = False
.MinimumScale = 0
.MaximumScale = 1.2
End With

End Sub

If you are automating Excel then qualify the workbook with your xlApp ref.

Regards,
Peter T

"Patrick" wrote in message
oups.com...
This seems like and probably is a trivial question, but I can't seem to
get it right. I've browsed through this group and found seemingly many
solutions that apply to chart objects, but not with a seperate chart
sheet im working with.

I am referencing the chart sheet via (Excel.Application).Charts(1)
like:

xlApp.Charts(1).Select

I am trying to find a simple way to read the min/max scale of the Y
axis, and if they are 0 to 1, change to 0 to 1.2. I've tried many
variations but can't seem to find one that actually works -- I also
recorded a macro to set this and it wouldnt seem to work either. Can
anyone provide a quick sample of what might be used to retrieve and/or
set the min/max scale values on a seperate chart sheet?

TIA

Pat



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Chart Sheet/Axes

Do you (or anyone) know of an easy way to determine what the
minimum/maximumscale is? I don't seem to be having problems setting the
scale, but I do have problems determining the current scale (most won't
be what I'm looking for)

Thanks in advance!

Peter T wrote:
I am referencing the chart sheet via (Excel.Application).Charts(1)


try a referencing a workbook chart sheet in the Workbook's Charts or Sheets
collection

Sub test()
Dim cht As Chart

Set cht = ActiveWorkbook.Charts("Chart3")

With cht.Axes(xlValue)
'might need to set respective 'ScaleIsAuto
'.MinimumScaleIsAuto = False
'.MaximumScaleIsAuto = False
.MinimumScale = 0
.MaximumScale = 1.2
End With

End Sub

If you are automating Excel then qualify the workbook with your xlApp ref.

Regards,
Peter T

"Patrick" wrote in message
oups.com...
This seems like and probably is a trivial question, but I can't seem to
get it right. I've browsed through this group and found seemingly many
solutions that apply to chart objects, but not with a seperate chart
sheet im working with.

I am referencing the chart sheet via (Excel.Application).Charts(1)
like:

xlApp.Charts(1).Select

I am trying to find a simple way to read the min/max scale of the Y
axis, and if they are 0 to 1, change to 0 to 1.2. I've tried many
variations but can't seem to find one that actually works -- I also
recorded a macro to set this and it wouldnt seem to work either. Can
anyone provide a quick sample of what might be used to retrieve and/or
set the min/max scale values on a seperate chart sheet?

TIA

Pat


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Chart Sheet/Axes

Dim dAxisMin as Double
dAxisMin = cht.Axes(xlValue).MinimumScale

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


"Patrick" wrote in message
ups.com...
Do you (or anyone) know of an easy way to determine what the
minimum/maximumscale is? I don't seem to be having problems setting the
scale, but I do have problems determining the current scale (most won't
be what I'm looking for)

Thanks in advance!

Peter T wrote:
I am referencing the chart sheet via (Excel.Application).Charts(1)


try a referencing a workbook chart sheet in the Workbook's Charts or
Sheets
collection

Sub test()
Dim cht As Chart

Set cht = ActiveWorkbook.Charts("Chart3")

With cht.Axes(xlValue)
'might need to set respective 'ScaleIsAuto
'.MinimumScaleIsAuto = False
'.MaximumScaleIsAuto = False
.MinimumScale = 0
.MaximumScale = 1.2
End With

End Sub

If you are automating Excel then qualify the workbook with your xlApp
ref.

Regards,
Peter T

"Patrick" wrote in message
oups.com...
This seems like and probably is a trivial question, but I can't seem to
get it right. I've browsed through this group and found seemingly many
solutions that apply to chart objects, but not with a seperate chart
sheet im working with.

I am referencing the chart sheet via (Excel.Application).Charts(1)
like:

xlApp.Charts(1).Select

I am trying to find a simple way to read the min/max scale of the Y
axis, and if they are 0 to 1, change to 0 to 1.2. I've tried many
variations but can't seem to find one that actually works -- I also
recorded a macro to set this and it wouldnt seem to work either. Can
anyone provide a quick sample of what might be used to retrieve and/or
set the min/max scale values on a seperate chart sheet?

TIA

Pat






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Chart Sheet/Axes

I apologize for another beginner level question, but I'm automating
Excel from Word (both Office XP/2002).

I have something like:

--snip--
Dim xlApp As Object
Dim dAxisMin as Double
....
Set xlApp = CreateObject("Excel.Application")
....
xlApp.Charts(1).Select
....
dAxisMin = xlApp.Charts(chNameTab).Axes(xlValue).MinimumScale
dAxisMax = xlApp.Charts(chNameTab).Axes(xlValue).MaximumScale
....
--snip--

The values of min/max should be 0/1, but they both either return 0 or
throw an exception about not being able to find Axes property. Am I
qualifying this properly?

Thanks


Jon Peltier wrote:
Dim dAxisMin as Double
dAxisMin = cht.Axes(xlValue).MinimumScale

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


"Patrick" wrote in message
ups.com...
Do you (or anyone) know of an easy way to determine what the
minimum/maximumscale is? I don't seem to be having problems setting the
scale, but I do have problems determining the current scale (most won't
be what I'm looking for)

Thanks in advance!

Peter T wrote:
I am referencing the chart sheet via (Excel.Application).Charts(1)

try a referencing a workbook chart sheet in the Workbook's Charts or
Sheets
collection

Sub test()
Dim cht As Chart

Set cht = ActiveWorkbook.Charts("Chart3")

With cht.Axes(xlValue)
'might need to set respective 'ScaleIsAuto
'.MinimumScaleIsAuto = False
'.MaximumScaleIsAuto = False
.MinimumScale = 0
.MaximumScale = 1.2
End With

End Sub

If you are automating Excel then qualify the workbook with your xlApp
ref.

Regards,
Peter T

"Patrick" wrote in message
oups.com...
This seems like and probably is a trivial question, but I can't seem to
get it right. I've browsed through this group and found seemingly many
solutions that apply to chart objects, but not with a seperate chart
sheet im working with.

I am referencing the chart sheet via (Excel.Application).Charts(1)
like:

xlApp.Charts(1).Select

I am trying to find a simple way to read the min/max scale of the Y
axis, and if they are 0 to 1, change to 0 to 1.2. I've tried many
variations but can't seem to find one that actually works -- I also
recorded a macro to set this and it wouldnt seem to work either. Can
anyone provide a quick sample of what might be used to retrieve and/or
set the min/max scale values on a seperate chart sheet?

TIA

Pat



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Chart Sheet/Axes

Apparently the code was fine all along but I was missing a reference to
Excel 10 (under tools from VBE). Seems to be working now.

Thanks

Patrick wrote:
I apologize for another beginner level question, but I'm automating
Excel from Word (both Office XP/2002).

I have something like:

--snip--
Dim xlApp As Object
Dim dAxisMin as Double
...
Set xlApp = CreateObject("Excel.Application")
...
xlApp.Charts(1).Select
...
dAxisMin = xlApp.Charts(chNameTab).Axes(xlValue).MinimumScale
dAxisMax = xlApp.Charts(chNameTab).Axes(xlValue).MaximumScale
...
--snip--

The values of min/max should be 0/1, but they both either return 0 or
throw an exception about not being able to find Axes property. Am I
qualifying this properly?

Thanks


Jon Peltier wrote:
Dim dAxisMin as Double
dAxisMin = cht.Axes(xlValue).MinimumScale

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


"Patrick" wrote in message
ups.com...
Do you (or anyone) know of an easy way to determine what the
minimum/maximumscale is? I don't seem to be having problems setting the
scale, but I do have problems determining the current scale (most won't
be what I'm looking for)

Thanks in advance!

Peter T wrote:
I am referencing the chart sheet via (Excel.Application).Charts(1)

try a referencing a workbook chart sheet in the Workbook's Charts or
Sheets
collection

Sub test()
Dim cht As Chart

Set cht = ActiveWorkbook.Charts("Chart3")

With cht.Axes(xlValue)
'might need to set respective 'ScaleIsAuto
'.MinimumScaleIsAuto = False
'.MaximumScaleIsAuto = False
.MinimumScale = 0
.MaximumScale = 1.2
End With

End Sub

If you are automating Excel then qualify the workbook with your xlApp
ref.

Regards,
Peter T

"Patrick" wrote in message
oups.com...
This seems like and probably is a trivial question, but I can't seem to
get it right. I've browsed through this group and found seemingly many
solutions that apply to chart objects, but not with a seperate chart
sheet im working with.

I am referencing the chart sheet via (Excel.Application).Charts(1)
like:

xlApp.Charts(1).Select

I am trying to find a simple way to read the min/max scale of the Y
axis, and if they are 0 to 1, change to 0 to 1.2. I've tried many
variations but can't seem to find one that actually works -- I also
recorded a macro to set this and it wouldnt seem to work either. Can
anyone provide a quick sample of what might be used to retrieve and/or
set the min/max scale values on a seperate chart sheet?

TIA

Pat



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
Having two X-axes on same chart Boon8888 Excel Discussion (Misc queries) 1 March 23rd 06 08:49 PM
Is it possible to add more than 2 x-axes to a chart? [email protected] Excel Programming 1 January 21st 06 10:50 AM
Two-Column, Two Axes Chart Michael Charts and Charting in Excel 1 December 7th 05 06:17 PM
XY-Chart with 4 axes monir Charts and Charting in Excel 3 December 3rd 05 09:57 PM
CHART AxES TITLE yorkielover02 Excel Discussion (Misc queries) 1 February 3rd 05 09:31 PM


All times are GMT +1. The time now is 02:02 AM.

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"