Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.sdk,microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default xlfArgument?

Thank you for your response, but could you please clarify it? Are you
saying that:
- xlfArgument is not supported in the API (in which case, I wonder why
the constant is defined in xlCall.h)?
- you personally do not see why anyone would use it?

If the latter, I may ultimately come to the same conclusion, once I know
how to use it. Meanwhile I am grasping at straws trying to find some
way around the "16384 bug" in passing arguments from Excel to C (see
unanswered question in separate thread of that title). That particular
bug does not impact =ARGUMENT() in Excel4 macros, so I wondered whether
it might be the basis of a workaround.

I suppose I could parse the entire formula from xlfGetCell
http://groups.google.com/groups?selm...A%40wanadoo.fr
but that seems overly painful.

Jerry

Jens Thiel wrote:

You do not use it at all! ARGUMENT doesn't make sense in the C API.

Jens.

--
Jens Thiel * Willy-Brandt-Allee 10 * D-53113 Bonn * +49 228 5400124
http://jens-thiel.de/ http://ManagedXLL.net/ http://QuantLib.net/

"Jerry W. Lewis" wrote in message
...

How does one use Excel4(xlfArgument, ...) in the C API?

XLOPER xArgRef;
Excel4(xlfArgument, &xArgRef, 1, TempInt(8));

returns xlretFailed.

Jerry


  #2   Report Post  
Posted to microsoft.public.excel.sdk,microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default xlfArgument?

"""
ARGUMENT

Describes the arguments used in a custom function, which is a type of macro,
or in a subroutine. A custom function or subroutine must contain one
ARGUMENT function for each argument in the macro itself
"""

As a C API developer, you use REGISTER where a macro sheet developer would
have used ARGUMENT.

The "16384 bug" can AFAIK not be avoided. The "workaround" would be to
examine the input range of a reference XLOPER (R type) and guess what the
user had in mind -- or issue at least a warning (watch out for ranges
starting at 0 with exactly 16384 columns - that shouldn't happen so often).

I would avoid parsing the formula. You would also need to to consider named
ranges etc. Instead I would use the R type only when necessary, since I
prefer the #VALUE error with the P and K types over the (silent) bug with
the R type.

Jens.

--
Jens Thiel * Willy-Brandt-Allee 10 * D-53113 Bonn * +49 228 5400124
http://jens-thiel.de/ http://ManagedXLL.net/ http://QuantLib.net/


"Jerry W. Lewis" wrote in message
...
Thank you for your response, but could you please clarify it? Are you
saying that:
- xlfArgument is not supported in the API (in which case, I wonder why
the constant is defined in xlCall.h)?
- you personally do not see why anyone would use it?

If the latter, I may ultimately come to the same conclusion, once I know
how to use it. Meanwhile I am grasping at straws trying to find some
way around the "16384 bug" in passing arguments from Excel to C (see
unanswered question in separate thread of that title). That particular
bug does not impact =ARGUMENT() in Excel4 macros, so I wondered whether
it might be the basis of a workaround.

I suppose I could parse the entire formula from xlfGetCell
http://groups.google.com/groups?selm...A%40wanadoo.fr
but that seems overly painful.

Jerry

Jens Thiel wrote:

You do not use it at all! ARGUMENT doesn't make sense in the C API.

Jens.

--
Jens Thiel * Willy-Brandt-Allee 10 * D-53113 Bonn * +49 228 5400124
http://jens-thiel.de/ http://ManagedXLL.net/ http://QuantLib.net/

"Jerry W. Lewis" wrote in message
...

How does one use Excel4(xlfArgument, ...) in the C API?

XLOPER xArgRef;
Excel4(xlfArgument, &xArgRef, 1, TempInt(8));

returns xlretFailed.

Jerry




  #3   Report Post  
Posted to microsoft.public.excel.sdk,microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default xlfArgument?

I had started out following the conventional wisdom of using OPERs
instead of xlOPERs, but accepting a range as a range (and then coercing
it) has the advantage that you can compare the requested range to the
used range and potentially reduce the amount of unnecessary work. This
also means that 16384 vs. 65536 is irrelevant if the last used row is <=
16384.

More problematic to parsing than named ranges, is the possibility that a
complex formula may call a given function more than once. That is why I
was hoping to be able to grab the actual argument that was specified,
when processing it.

Jerry

Jens Thiel wrote:

"""
ARGUMENT

Describes the arguments used in a custom function, which is a type of macro,
or in a subroutine. A custom function or subroutine must contain one
ARGUMENT function for each argument in the macro itself
"""

As a C API developer, you use REGISTER where a macro sheet developer would
have used ARGUMENT.

The "16384 bug" can AFAIK not be avoided. The "workaround" would be to
examine the input range of a reference XLOPER (R type) and guess what the
user had in mind -- or issue at least a warning (watch out for ranges
starting at 0 with exactly 16384 columns - that shouldn't happen so often).

I would avoid parsing the formula. You would also need to to consider named
ranges etc. Instead I would use the R type only when necessary, since I
prefer the #VALUE error with the P and K types over the (silent) bug with
the R type.

Jens.

--
Jens Thiel * Willy-Brandt-Allee 10 * D-53113 Bonn * +49 228 5400124
http://jens-thiel.de/ http://ManagedXLL.net/ http://QuantLib.net/


"Jerry W. Lewis" wrote in message
...

Thank you for your response, but could you please clarify it? Are you
saying that:
- xlfArgument is not supported in the API (in which case, I wonder why
the constant is defined in xlCall.h)?
- you personally do not see why anyone would use it?

If the latter, I may ultimately come to the same conclusion, once I know
how to use it. Meanwhile I am grasping at straws trying to find some
way around the "16384 bug" in passing arguments from Excel to C (see
unanswered question in separate thread of that title). That particular
bug does not impact =ARGUMENT() in Excel4 macros, so I wondered whether
it might be the basis of a workaround.

I suppose I could parse the entire formula from xlfGetCell
http://groups.google.com/groups?selm...A%40wanadoo.fr
but that seems overly painful.

Jerry

Jens Thiel wrote:


You do not use it at all! ARGUMENT doesn't make sense in the C API.

Jens.

--
Jens Thiel * Willy-Brandt-Allee 10 * D-53113 Bonn * +49 228 5400124
http://jens-thiel.de/ http://ManagedXLL.net/ http://QuantLib.net/

"Jerry W. Lewis" wrote in message
...


How does one use Excel4(xlfArgument, ...) in the C API?

XLOPER xArgRef;
Excel4(xlfArgument, &xArgRef, 1, TempInt(8));

returns xlretFailed.

Jerry




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



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