- Joined
- 12/15/12
- Messages
- 3
- Points
- 11
Hi everyone,
I guess some of you have worked with user-defined functions (UDFs) in Excel using your own Addin. I am currently working with XLW, which is a wrapper that simplifies creating Addins (*.xll) with Visual C++.
Imagine the following C++ sample code, which increments the first parameter and then returns a sum.
-------------------------------------------------------
double sumOfTwo(double &arg1, double &arg2)
{
arg1++; // increment arg1 for some reason
return arg1+arg2;
}
-------------------------------------------------------
With an .xll (or .dll respectively) I can now call this function in an Excel cell, e.g. "=sumOfTwo(A1;A2)"
The cell with the formula displays the correct sum, but the value in A1 is not incremented. Do you have an idea how to make a correct By-Reference call from Excel to C++ / XLW ?
I'm basically looking for a way to manipulate a cell, which is used as function parameter.
Cheers
SeanKw
I guess some of you have worked with user-defined functions (UDFs) in Excel using your own Addin. I am currently working with XLW, which is a wrapper that simplifies creating Addins (*.xll) with Visual C++.
Imagine the following C++ sample code, which increments the first parameter and then returns a sum.
-------------------------------------------------------
double sumOfTwo(double &arg1, double &arg2)
{
arg1++; // increment arg1 for some reason
return arg1+arg2;
}
-------------------------------------------------------
With an .xll (or .dll respectively) I can now call this function in an Excel cell, e.g. "=sumOfTwo(A1;A2)"
The cell with the formula displays the correct sum, but the value in A1 is not incremented. Do you have an idea how to make a correct By-Reference call from Excel to C++ / XLW ?
I'm basically looking for a way to manipulate a cell, which is used as function parameter.
Cheers
SeanKw
Last edited: