View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default How to parse UDF arguments? (separators are localized)

Not sure why you would want to go to the trouble of parsing out and then
evaluating UDF arguments from a text string.
(I can foresee a lot of difficulties to overcome if you want to handle the
general case for anything that could be an argument).

But you can get the separator character from
Application.International(xlListSeparator)

(although I have met one case where this gave ; but Excel was actually using
, never did really get to the bottom of that we just bypassed the problem)

regards
Charles
_________________________________________
FastExcel 2.3
Name Manager 4.0
http://www.DecisionModels.com

"Joannes Vermorel" wrote in message
...
We have designed an add-in for Excel 2003 in C# that need to parse the
arguments of an Excel UDF function (the content of the cell being
retrieved as text).

So far, we were just using an ad-hoc parser, but it fails within
localized version of Excel that do not use the comma as argument
separator.

What it the "safe" way to parse Excel function arguments? Is there any
way to know what is the separator character that should be used?

Thanks in advance,
Joannès