473,396 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Variable number of parameters in Excel User Defined Function

Hey All,

I'm writing a C# automation add-in for Excel 2003 and I need to be able to
pass in an undefined number of object parameters (ie noncontiguous cells) to
my UDF. This is achieved in VBA by using the ParamArray, but the C# params
doesn't seem to work.

Does anyone know a way I can do this without hardcoding in "optional"
parameters? Let me know if there's anything else that would be helpful to
know.

Thanks
Dec 12 '07 #1
1 2994
Try this method signature:
Object MyFunc(params Object[][,] YourCells)

You may find other useful info on this topic in my blog. If you get a
successful deployment, please let me know.

Tony Gravagno
Nebula Research and Development
remove.mungeNebula-RnD.com/blog/tech/2007/11/excel-tools5.html

ep wrote:
>Hey All,

I'm writing a C# automation add-in for Excel 2003 and I need to be able to
pass in an undefined number of object parameters (ie noncontiguous cells) to
my UDF. This is achieved in VBA by using the ParamArray, but the C# params
doesn't seem to work.

Does anyone know a way I can do this without hardcoding in "optional"
parameters? Let me know if there's anything else that would be helpful to
know.

Thanks
Dec 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Suzanne Vogel | last post by:
'stdarg.h' defines the 'va_arg' type to use in passing variable numbers of parameters to functions. The example of its use given in the Dinkumware documentation *seems* to imply that the 'va_arg'...
3
by: Edward | last post by:
ASP.NET / VB.NET SQL Server 7.0 Our client has insisted that we change our established practice of building SQL in-line and move it all to SPROCs. Not a problem for 80% of the app. However,...
4
by: nelsonchang | last post by:
Dear all, I wrote the VB code in a "button press event" as below in which is retrieve data from SQL server and insert the data into Excel. After that, I would call Excel "subtotal" API to build a...
2
by: Tonia T. | last post by:
I am trying to call a VB function from excel. The function initially had 22 arguments, and worked OK. Now it has 23 arguments. Excel seems to have trouble loading this function. When I try to...
10
by: CJM | last post by:
I'm trying to call a package/procedure in oracle (from an ASP page) which requires a number of parameters. I have got this working using OO40 but unfortunately the transaction rollback function...
7
by: Kristian Virkus | last post by:
Hello! I would like to write a C programm with multiple include files, where one may use another one (to print the value of a variable). When I try to compile the program below, the linker...
6
by: trungthanh78 | last post by:
Hello everyone, I'm totally new to the group and I would like to learn from you. Thank you in advance! I need to write a program to track whether a mathematical function has changed during...
11
by: Googy | last post by:
Hi friends!! As we know that the input parameters in a function is fixed when the function is defined but how does printf processes variable number of input arguments ? For example: 1....
11
by: Jef Driesen | last post by:
I have the following problem in a C project (but that also needs to compile with a C++ compiler). I'm using a virtual function table, that looks like this in the header file: typedef struct...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.