Need to register a UDF (xlfRegister) that takes no param

N

nicolas.gendron

Hi,

I'm registering a UDF function in Excel via Excel4(xlfRegister, ...).

I want to register a simple fonction that just returns a string value
(no need to pass parameters to the function)

The problem is that the function paste dialog always ask for one
arguments.

I'm using "R#!" and I give an empty string for args names.

Any help would be greatly appreciated!

Thanks a lot,

Nicolas
 
N

Niek Otten

Hi Nicolas,

What is the code of your function and with what formula do you call it?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi,
|
| I'm registering a UDF function in Excel via Excel4(xlfRegister, ...).
|
| I want to register a simple fonction that just returns a string value
| (no need to pass parameters to the function)
|
| The problem is that the function paste dialog always ask for one
| arguments.
|
| I'm using "R#!" and I give an empty string for args names.
|
| Any help would be greatly appreciated!
|
| Thanks a lot,
|
| Nicolas
|
 
N

nicolas.gendron

Hi,

The function prototype is :

XLOPER* VssGetTriggerTime()
{
// ... (code that just puts a simple string in the returning
XLOPER*) ...
}

I'm registering it with Excel4(xlfRegister, ... )

int err = Excel4(xlfRegister, 0, 10,
&xlDllName, // Full drive, path
and filename of the DLL
&xlInternalName, // "VssGetTriggerTime"
&xlFctPrototype, // "R#!"
&xlInternalName, // "VssGetTriggerTime"
&xlArgNames, // ""
&xlFctType, // 1 (function)
&xlFctCategory, // ""
&xlEmpty, // "" (Not Used)
&xlEmpty, // "" (no help topic)
&xlFctDescription); // "Get a simple string"

My function appear in the paste dialog.
I can select it, but the function dialog ask me for an argument.

If I write noting, the function is returning the test string.
If I write something, the function is returning #VALUE.

Why ...?

I hope this will help you!

Regards,

Nicolas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top