PDA

View Full Version : IsUDF Function



Zack Barresse
08-15-2005, 01:56 PM
Okay, so I remember seeing somewhere this function made by a couple of MS MVP's that tested whether or not a function was a UDF or native function. I thought it was on the Newsgroups, but I can't find it.

Does anybody have this UDF or know where I can find it again?! I'd love to use it again..

MOS MASTER
08-15-2005, 02:23 PM
Sure from our VBAX MVP Justin! :giggle

http://www.vbaexpress.com/kb/getarticle.php?kb_id=601

Bob Phillips
08-15-2005, 02:37 PM
I remember this Zack. The main thread was trying to get the procedure handle using the AddressOf operator, which would identify a function within the active project. Nice idea, and I managed to get it to work for him in Excel 97 using the Getz/Kaplan AddressOf emulator, but not a later version.

A simple version can be built by looping through each code module, checcking each proc in that module, and if the same name and a Function, return True.

.

Ken Puls
08-15-2005, 02:53 PM
A simple version can be built by looping through each code module, checcking each proc in that module, and if the same name and a Function, return True.

To make this reliable, though, wouldn't you have to loop through all open workbooks and installed addins?

Problem is, if the UDF resides in an addin with a protected project, you're SOL as it will just error out on you... unless I'm mistaken. :dunno

MOS MASTER
08-15-2005, 02:56 PM
Well judging by your answers I must have fully missed the boat on understanding this question....:mkay

Ken Puls
08-15-2005, 03:38 PM
Well judging by your answers I must have fully missed the boat on understanding this question....:mkay

No, not at all! I was simply querying Bob's approach. I haven't actually tried Justin's KB entry, but it's sold as one tool to do the job. (Actually, Zack should be a little embarassed for not looking in the KB first! :nono)

:rotlaugh:

Bob Phillips
08-15-2005, 03:56 PM
No, not at all! I was simply querying Bob's approach. I haven't actually tried Justin's KB entry, but it's sold as one tool to do the job. (Actually, Zack should be a little embarassed for not looking in the KB first! )


That KB article approach is pretty flawed. It builds an array of built-in functions, which means that it has to be kept up-to-date, a function such as Split in Excel 97 would report as Native when it would be a UDF, it reports my used Excel names as native functions, it only looks at the first function in a formula, thereby potentially missing the embedded UDF, and it even returns =A1 as a native function. Not one that I think I will add to my library.

Ken Puls
08-15-2005, 04:43 PM
Hey Bob,

Those are fair points that you raise, and definately concerns that should be thought about if using Justin's approach. :yes Providing you're using it in the version he authored the entry in (2000?), then they're shouldn't be too much of an issue with it though. (IMHO anyway.)

Now, any chance on getting you to submit your suggested method to the KB? I still think that it has a potential issue with the protected project scenario, but that's just a caveat on the discussion really. (Again, unless I'm wrong here, and would be happy to be proved as such!) :)

Bob Phillips
08-15-2005, 04:56 PM
Those are fair points that you raise, and definately concerns that should be thought about if using Justin's approach. :yes Providing you're using it in the version he authored the entry in (2000?), then they're shouldn't be too much of an issue with it though. (IMHO anyway.)

I was using 2000 when I ran it.


Now, any chance on getting you to submit your suggested method to the KB? I still think that it has a potential issue with the protected project scenario, but that's just a caveat on the discussion really. (Again, unless I'm wrong here, and would be happy to be proved as such!) :)

Okay Ken, I'll cut that and we'll see what we get. Even when there are issues, it still is a valid KB item as we are talking techniques here. I assume you mean the simple iterative process not the Addresof soluition (never did finish that one)

Ken Puls
08-15-2005, 05:04 PM
Hey Bob,

You bet. The simple one. We'll wait for the second till you finish it! ;)

Ivan F Moala
08-16-2005, 01:37 AM
I was using 2000 when I ran it.



Okay Ken, I'll cut that and we'll see what we get. Even when there are issues, it still is a valid KB item as we are talking techniques here. I assume you mean the simple iterative process not the Addresof soluition (never did finish that one)

I'd be more interested in the Addressof solution (Not for Xl97 where you would need to use the work around)

Justinlabenne
08-16-2005, 03:26 AM
I would definitely like to see a better version of the kb I submitted, or at least any ways to make it better, or a method completely different.

I had help on it's design, and it was discussed that it would need updates, etc.. when more functions are added so it does have some serious limits, but was the only justifiable working solution I could come up with at the time :bug:

Can't wait for Bob's....

Ken Puls
08-16-2005, 09:29 AM
I'd be more interested in the Addressof solution

Be interested in both, actually. :yes The more in the KB the merrier!

MOS MASTER
08-16-2005, 10:41 AM
No, not at all! I was simply querying Bob's approach. I haven't actually tried Justin's KB entry, but it's sold as one tool to do the job. (Actually, Zack should be a little embarassed for not looking in the KB first! :nono)

:rotlaugh:

Hmmzz A..Ok..I thought I was loosing it reading Bob's detour and your reply to it.

O well..then I'm partially Mad! :rofl:

Zack Barresse
08-16-2005, 10:59 AM
Hmm, couple of points to make here...

1) Didn't look at the KB, my fault. :( I'll take my licks Ken. ;)

2) Can't wait for Bob's solution.

3) Moose - you can't be mad!! :D

4) Miss a couple of days, miss a whole page of replies!! :eek:

MOS MASTER
08-16-2005, 11:06 AM
3) Moose - you can't be mad!! :D

4) Miss a couple of days, miss a whole page of replies!! :eek:

3).....?...are you sure...been feeling like I am lately...:giggle

4) Yes..you've been ignoring us...while we've been so helpfull to you! :devil:

Ken Puls
08-16-2005, 12:43 PM
3).....?...are you sure...been feeling like I am lately...:giggle

I'll vouch for you being mad, buddy! :*)

:rotlaugh:


4) Yes..you've been ignoring us...while we've been so helpfull to you! :devil:

Shame on you again, Zack! Here you were out listening to Ted Nugget and ignoring your hard working friends! :nono

Zack Barresse
08-16-2005, 02:18 PM
Yes, I admit it, I went and saw Ted "McNugget" Nugent. And I did it whilst everyone was here at VBAX, diligently working their Tushy's off. I have been a very bad person. Moose, do you think Babydum can help me? I think I need help; they say admittance is the first step.. :mkay


..I'd be more interested in the Addressof solution ..
I, too, would be interested in such a solution. :)

MOS MASTER
08-16-2005, 02:47 PM
Yes, I admit it, I went and saw Ted "McNugget" Nugent. And I did it whilst everyone was here at VBAX, diligently working their Tushy's off. I have been a very bad person. Moose, do you think Babydum can help me? I think I need help; they say admittance is the first step.. :mkay


Yes I think Babydum can help you for sure!

He's helping me git rid of the Moose in me...

And you know things always get worse before improvements arise! (So yes, I keep on hoping) :(

Please post a question to Doctor B in the Off topic forum. :yes

Ken Puls
08-16-2005, 02:54 PM
Yes I think Babydum can help you for sure!

He's helping me git rid of the Moose in me...

But... but... we love the Moose! :eek:

MOS MASTER
08-16-2005, 03:01 PM
But... but... we love the Moose! :eek:

Well...rest ashured.. Doctor B told me it would take 2 years to heal from a mixed identity crisis....

A long way to go indeed...:giggle

Ken Puls
08-16-2005, 03:10 PM
Ah! Well that is good news indeed! :thumb

PS: Zack, just let us know when you want your thread back! ;)

Zack Barresse
08-16-2005, 04:33 PM
Hoping Bob will re-hijack when he's ready. ;)