Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default international problem, decimal separator and chart series

Hello Excel NewsGroup,

I've run across a strange behavior in excel (2000 and XP) when running on a system with a non-english installation. When running the following code, a chart series is the current Selection, and I am trying to change its definition to display specific hardwired points.

xmn = 0
xmx = 1.1
ymn = 0
ymx = 1.1
With Selection
.XValues = CStr(xmn) & "," & Str(xmx)
.Values = Str(ymn) & "," & Str(ymx)
End With


In the above code, I found that the CStr and Str function calls are required to get the correct result. Does anyone know why CStr seems to be required?

Thanks,

Brian Murphy
Austin, Texas

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default international problem, decimal separator and chart series

If xmx and ymx are variants, I expect that they are getting stored as
numbers.
CStr and Str convert them to strings.
--
http://www.standards.com/; See Howard Kaikow's web site.
"Brian Murphy" wrote in message
...
Hello Excel NewsGroup,

I've run across a strange behavior in excel (2000 and XP) when running on a
system with a non-english installation. When running the following code, a
chart series is the current Selection, and I am trying to change its
definition to display specific hardwired points.

xmn = 0
xmx = 1.1
ymn = 0
ymx = 1.1
With Selection
.XValues = CStr(xmn) & "," & Str(xmx)
.Values = Str(ymn) & "," & Str(ymx)
End With


In the above code, I found that the CStr and Str function calls are required
to get the correct result. Does anyone know why CStr seems to be required?

Thanks,

Brian Murphy
Austin, Texas



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default international problem, decimal separator and chart series

Hello Howard,

All variables are Dim'ed As Double. But that probably doesn't matter.

The part that is baffling about this is that exactly one instance if CStr is
required in the place shown, while the other three have to be Str. Other
variations do not work.

The only reason I can think of why this might be is maybe that the X values
can be text for certain excel chart types, but the Y values can't, thus
excel processes their values using different rules upon input (here the
chart type is XY Scatter).

Do you know if this the case?

Thanks,

Brian



"Howard Kaikow" wrote in message
...
If xmx and ymx are variants, I expect that they are getting stored as
numbers.
CStr and Str convert them to strings.
--
http://www.standards.com/; See Howard Kaikow's web site.
"Brian Murphy" wrote in message
...
Hello Excel NewsGroup,

I've run across a strange behavior in excel (2000 and XP) when running on

a
system with a non-english installation. When running the following code,

a
chart series is the current Selection, and I am trying to change its
definition to display specific hardwired points.

xmn = 0
xmx = 1.1
ymn = 0
ymx = 1.1
With Selection
.XValues = CStr(xmn) & "," & Str(xmx)
.Values = Str(ymn) & "," & Str(ymx)
End With


In the above code, I found that the CStr and Str function calls are

required
to get the correct result. Does anyone know why CStr seems to be

required?

Thanks,

Brian Murphy
Austin, Texas





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default international problem, decimal separator and chart series

Brian -

I don't know why CStr would be needed for one of them, while Str works
for the rest, unless you typed a capital o instead of a zero, and your
eyes can't tell the difference. Since you're building a string to hold
a literal array, that's why you need string representations of your numbers.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Brian Murphy wrote:

Hello Excel NewsGroup,

I've run across a strange behavior in excel (2000 and XP) when running on a system with a non-english installation. When running the following code, a chart series is the current Selection, and I am trying to change its definition to display specific hardwired points.

xmn = 0
xmx = 1.1
ymn = 0
ymx = 1.1
With Selection
.XValues = CStr(xmn) & "," & Str(xmx)
.Values = Str(ymn) & "," & Str(ymx)
End With


In the above code, I found that the CStr and Str function calls are required to get the correct result. Does anyone know why CStr seems to be required?

Thanks,

Brian Murphy
Austin, Texas


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default international problem, decimal separator and chart series

Hello Jon,

Hope things are well with you and family.

I ran into even more serious problems the way I was doing this. But I now have it cured by using the Array function instead of pseudo strings.

With Selection
'change to use Array for setting hardwired chart values 12/15/2003
.XValues = Array(xmn, xmx)
.Values = Array(ymn, ymx)

I should have done it this way in the first place. This works in every case I have tested, and seems to be immune to "international" issues.

Cheers,

Brian



"Jon Peltier" wrote in message ...
Brian -

I don't know why CStr would be needed for one of them, while Str works
for the rest, unless you typed a capital o instead of a zero, and your
eyes can't tell the difference. Since you're building a string to hold
a literal array, that's why you need string representations of your numbers.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Brian Murphy wrote:

Hello Excel NewsGroup,

I've run across a strange behavior in excel (2000 and XP) when running on a system with a non-english installation. When running the following code, a chart series is the current Selection, and I am trying to change its definition to display specific hardwired points.

xmn = 0
xmx = 1.1
ymn = 0
ymx = 1.1
With Selection
.XValues = CStr(xmn) & "," & Str(xmx)
.Values = Str(ymn) & "," & Str(ymx)
End With


In the above code, I found that the CStr and Str function calls are required to get the correct result. Does anyone know why CStr seems to be required?

Thanks,

Brian Murphy
Austin, Texas




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default international problem, decimal separator and chart series

Hi Brian -

Duh, I should have thought of Array. When building a string, you need
to also include the "{" and "}" around the strings containing comma
separated values.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Brian Murphy wrote:

Hello Jon,

Hope things are well with you and family.

I ran into even more serious problems the way I was doing this. But I now have it cured by using the Array function instead of pseudo strings.

With Selection
'change to use Array for setting hardwired chart values 12/15/2003
.XValues = Array(xmn, xmx)
.Values = Array(ymn, ymx)

I should have done it this way in the first place. This works in every case I have tested, and seems to be immune to "international" issues.

Cheers,

Brian



"Jon Peltier" wrote in message ...

Brian -

I don't know why CStr would be needed for one of them, while Str works
for the rest, unless you typed a capital o instead of a zero, and your
eyes can't tell the difference. Since you're building a string to hold
a literal array, that's why you need string representations of your numbers.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Brian Murphy wrote:


Hello Excel NewsGroup,

I've run across a strange behavior in excel (2000 and XP) when running on a system with a non-english installation. When running the following code, a chart series is the current Selection, and I am trying to change its definition to display specific hardwired points.

xmn = 0
xmx = 1.1
ymn = 0
ymx = 1.1
With Selection
.XValues = CStr(xmn) & "," & Str(xmx)
.Values = Str(ymn) & "," & Str(ymx)
End With


In the above code, I found that the CStr and Str function calls are required to get the correct result. Does anyone know why CStr seems to be required?

Thanks,

Brian Murphy
Austin, Texas




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
International decimal number formats John Cleese via OfficeKB.com Excel Discussion (Misc queries) 5 January 15th 07 03:11 PM
International number separator bibi Excel Worksheet Functions 1 August 4th 05 07:13 AM
International number separator bibi Excel Worksheet Functions 0 August 3rd 05 06:49 PM
Decimal separator Tom Ogilvy Excel Programming 0 September 25th 03 03:42 PM
Decimal separator jacob[_3_] Excel Programming 0 September 25th 03 09:38 AM


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