Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default VBA in Excel 97 and 2003

Hello,

The following macro works fine in Excel 2003. Its purpose is to set the
origin of the 2 axes (x and y, with a timescale on both x and y) of a
graphe.
On my PC which is running Excel 2003, every work fine. On others PCs with
Excel 97, it bumps on the line :
.MinimumScale = Deb
with the error message : "Impossible to set the MinimumScale property"
What is the problem?
Thanks for your help!

Newbie

----------------------------
Sub CalerOrigineAxes()
Dim Graphique As Object, Crobard As Object
Dim Deb As Long, Fin As Long, Clic As Integer

For Each Graphique In ActiveSheet.ChartObjects
Deb = [DebProj] 'Date de début du projet
Fin = [FinProj] 'Date de fin du projet
Set Crobard = Graphique.Chart

Clic = MsgBox("Confirmez vous la date de Début du projet : " &
Format(Deb, "dd/mm/yyyy") & Chr(13) & _
"et la date de Fin : " & Format(Fin, "dd/mm/yyyy") & Chr(13) & Chr(13) &
"Sinon, corrigez les dans la feuille Excel", vbOKCancel, "Caler l'origine
des axes")
If Clic = vbCancel Then Exit Sub 'Si l'utilisateur à cliqué sur
annuler...


With Crobard.Axes(xlCategory)
.MinimumScale = Deb
.MaximumScale = Fin
.MinorUnit = 1
.MajorUnit = 15
.Crosses = xlCustom
.CrossesAt = Deb
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default VBA in Excel 97 and 2003

Following works fine in my XL97

Sub test()
Dim ax As Axis
Dim d As Double
Set ax = ActiveSheet.ChartObjects(1).Chart.Axes(xlValue, _
xlPrimary)
d = ax.MinimumScale
MsgBox d
ax.MinimumScale = d - 1

End Sub

Would suggest there's something different about the chart/axis or the code
in your respective versions. Are you referring to an axis that has a
minimum scale, also look manually.

Regards,
Peter T


"Newbie" wrote in message
...
Hello,

The following macro works fine in Excel 2003. Its purpose is to set the
origin of the 2 axes (x and y, with a timescale on both x and y) of a
graphe.
On my PC which is running Excel 2003, every work fine. On others PCs with
Excel 97, it bumps on the line :
.MinimumScale = Deb
with the error message : "Impossible to set the MinimumScale property"
What is the problem?
Thanks for your help!

Newbie

----------------------------
Sub CalerOrigineAxes()
Dim Graphique As Object, Crobard As Object
Dim Deb As Long, Fin As Long, Clic As Integer

For Each Graphique In ActiveSheet.ChartObjects
Deb = [DebProj] 'Date de début du projet
Fin = [FinProj] 'Date de fin du projet
Set Crobard = Graphique.Chart

Clic = MsgBox("Confirmez vous la date de Début du projet : " &
Format(Deb, "dd/mm/yyyy") & Chr(13) & _
"et la date de Fin : " & Format(Fin, "dd/mm/yyyy") & Chr(13) & Chr(13)

&
"Sinon, corrigez les dans la feuille Excel", vbOKCancel, "Caler l'origine
des axes")
If Clic = vbCancel Then Exit Sub 'Si l'utilisateur à cliqué sur
annuler...


With Crobard.Axes(xlCategory)
.MinimumScale = Deb
.MaximumScale = Fin
.MinorUnit = 1
.MajorUnit = 15
.Crosses = xlCustom
.CrossesAt = Deb
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default VBA in Excel 97 and 2003

Assuming on the troublesome machines DEB holds a valid value for the graph
(and the graph is off the correct type to use it and so forth - all these
type problems have been eliminated by seeing if you can perform the action
manually).


If you can physically go to one of the PC's after the error, go to the VBE
and with the bad workbook as the activeproject in the vbe, go to
tools=references and see if you see MISSING for one or more references.
(you may have to hit the reset button first).

If you do find one or more references as MISSING, you need to clear up the
reference and get a good reference set (or remove the reference if it is not
needed).
--
Regards,
Tom Ogilvy



"Newbie" wrote:

Hello,

The following macro works fine in Excel 2003. Its purpose is to set the
origin of the 2 axes (x and y, with a timescale on both x and y) of a
graphe.
On my PC which is running Excel 2003, every work fine. On others PCs with
Excel 97, it bumps on the line :
.MinimumScale = Deb
with the error message : "Impossible to set the MinimumScale property"
What is the problem?
Thanks for your help!

Newbie

----------------------------
Sub CalerOrigineAxes()
Dim Graphique As Object, Crobard As Object
Dim Deb As Long, Fin As Long, Clic As Integer

For Each Graphique In ActiveSheet.ChartObjects
Deb = [DebProj] 'Date de début du projet
Fin = [FinProj] 'Date de fin du projet
Set Crobard = Graphique.Chart

Clic = MsgBox("Confirmez vous la date de Début du projet : " &
Format(Deb, "dd/mm/yyyy") & Chr(13) & _
"et la date de Fin : " & Format(Fin, "dd/mm/yyyy") & Chr(13) & Chr(13) &
"Sinon, corrigez les dans la feuille Excel", vbOKCancel, "Caler l'origine
des axes")
If Clic = vbCancel Then Exit Sub 'Si l'utilisateur Ã* cliqué sur
annuler...


With Crobard.Axes(xlCategory)
.MinimumScale = Deb
.MaximumScale = Fin
.MinorUnit = 1
.MajorUnit = 15
.Crosses = xlCustom
.CrossesAt = Deb
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With



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
Excel 2007 versus Excel 2003 & Excel 97-2003 fully compatible Bumpersnesty Excel Worksheet Functions 0 April 26th 10 09:44 PM
importing/linking data from an Access 2003 Query to an Excel 2003 PerryK Excel Discussion (Misc queries) 2 August 24th 09 07:06 PM
Convert Excel 2003 spreadsheet into Outlook Contacts table 2003 Stuart[_4_] Excel Discussion (Misc queries) 2 October 6th 08 05:07 PM
Copying Excel 2003 Selection into Outlook 2003 HTML E-Mail Message [email protected] Excel Discussion (Misc queries) 0 July 10th 06 03:07 PM
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 Joel Berry Excel Programming 9 March 6th 06 10:20 PM


All times are GMT +1. The time now is 12:16 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"