ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TypeLib Information Problem? Pass a Function's parameter names as string for parsing? (https://www.excelbanter.com/excel-programming/318273-typelib-information-problem-pass-functions-parameter-names-string-parsing.html)

Ali G

TypeLib Information Problem? Pass a Function's parameter names as string for parsing?
 
I am trying to build a wizard with a form based GUI to facilitate the
use of functions supported by an excel add-in. Each function has a set
of required parameters. I will use a text box on the form for the user
to input each value to be passed to the parameters of the addin
function. Is it possible to interrogate the addin to have an array
returned telling me the required parameters? In the same way that the
object explorer can tell you e.g.,

Function AddInFunction(Parameter1 As Long, Parameter2 As Date,
[Parameter3 As Date])

Member of MyAddin.Main

Just to be able to assign that lot to a string variable would be
awesome. The idea being that my addin wizard would be flexible to any
changes made to the addin. From reading prior posts it seemed like
this might be possible using a TypeLib API method. However when I run
the necessary code on the MyAddin.xla file itself I get an error
saying the file doesn't contain a valid TypeLib. The addin does ship
with a library file but this seems to list only the activex functions
called by the addin and not the functions the addin offwers that act
as a wrapper to these active-x calls. Am I trying to do something that
is not possible?

david mcritchie

TypeLib Information Problem? Pass a Function's parameter names as string for parsing?
 
Hi Ali,
You might build it into the your add-in so one can key in "Help"
for the first parameter. Make all of your parameters optional.
It is best to name your parameters so that you know what is
wanted as Excel does not provide decent facilities for describing
each parameter of user defined functions.

See http://www.mvps.org/dmcritchie/excel...ll.htm#fundesc

Laurent Longre has information on adding descriptions for parameters,
his site is in French. This particular on is probably one is in English.
http://longre.free.fr/english/
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Ali G" wrote in message om...
I am trying to build a wizard with a form based GUI to facilitate the
use of functions supported by an excel add-in. Each function has a set
of required parameters. I will use a text box on the form for the user
to input each value to be passed to the parameters of the addin
function. Is it possible to interrogate the addin to have an array
returned telling me the required parameters? In the same way that the
object explorer can tell you e.g.,

Function AddInFunction(Parameter1 As Long, Parameter2 As Date,
[Parameter3 As Date])

Member of MyAddin.Main

Just to be able to assign that lot to a string variable would be
awesome. The idea being that my addin wizard would be flexible to any
changes made to the addin. From reading prior posts it seemed like
this might be possible using a TypeLib API method. However when I run
the necessary code on the MyAddin.xla file itself I get an error
saying the file doesn't contain a valid TypeLib. The addin does ship
with a library file but this seems to list only the activex functions
called by the addin and not the functions the addin offwers that act
as a wrapper to these active-x calls. Am I trying to do something that
is not possible?





All times are GMT +1. The time now is 12:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com