PC Review


Reply
Thread Tools Rate Thread

Add-In Visibility

 
 
Trent Argante
Guest
Posts: n/a
 
      13th Feb 2008
I've written a user-defiend function, meant to be called from a cell via "=",
have put it in an .xla file, have loaded the .xla via Tools | Add-Ins, but it
is not visible to the cell unless I include the module's name. The formula
box "sees" it but doesn't interact with it:

Doesn't Work: =AverageB(rRng,sLower,sUpper).
Works: =mdlAverageB.AverageB(rRng,sLower,sUpper).

I don't think this is a coding issue, but in the following, the declarations
haven't been included for brevity's sake:

Public Function AverageB(rRng As Range, sLower As Single, sUpper As Single)
As Single
' TPAC.J(254).CSR():20080123W1807E:20080123w1842e
For Each r In rRng
' Standard Average for future reference - is not returned by fnc
intCount = intCount + 1
sglSum = sglSum + r.Value

' Bound Average
If r.Value >= sLower And r.Value <= sUpper Then
intAvgBCount = intAvgBCount + 1
sglAvgBSum = sglAvgBSum + r.Value
End If
Next

' Standard Average for future reference - is not returned by fnc
sglAvg = sglSum / intCount 'Returns std Avg()'s value

AverageB = sglAvgBSum / intAvgBCount
End Function

Grazie,
--
Trent Argante
[DC.J(254)]
 
Reply With Quote
 
 
 
 
Ron Rosenfeld
Guest
Posts: n/a
 
      13th Feb 2008
On Wed, 13 Feb 2008 05:19:01 -0800, Trent Argante
<(E-Mail Removed)> wrote:

>I've written a user-defiend function, meant to be called from a cell via "=",
>have put it in an .xla file, have loaded the .xla via Tools | Add-Ins, but it
>is not visible to the cell unless I include the module's name. The formula
>box "sees" it but doesn't interact with it:
>
> Doesn't Work: =AverageB(rRng,sLower,sUpper).
> Works: =mdlAverageB.AverageB(rRng,sLower,sUpper).
>
>I don't think this is a coding issue, but in the following, the declarations
>haven't been included for brevity's sake:
>
>Public Function AverageB(rRng As Range, sLower As Single, sUpper As Single)
>As Single
>' TPAC.J(254).CSR():20080123W1807E:20080123w1842e
> For Each r In rRng
> ' Standard Average for future reference - is not returned by fnc
> intCount = intCount + 1
> sglSum = sglSum + r.Value
>
> ' Bound Average
> If r.Value >= sLower And r.Value <= sUpper Then
> intAvgBCount = intAvgBCount + 1
> sglAvgBSum = sglAvgBSum + r.Value
> End If
> Next
>
> ' Standard Average for future reference - is not returned by fnc
> sglAvg = sglSum / intCount 'Returns std Avg()'s value
>
> AverageB = sglAvgBSum / intAvgBCount
>End Function
>
>Grazie,


I presume when you write "Tools/AddIns" that you are referring to the menu
selection in Excel.

That being the case, in my limited experience, the reason for the behaviour you
see is that there is a naming conflict. Perhaps there is another AverageB
function defined in some other open Workbook.
--ron
 
Reply With Quote
 
RichardSchollar
Guest
Posts: n/a
 
      13th Feb 2008
Along the same vein as what Ron has mentioned - and this always
catches me out - have you named the module in which the function
resides to be the name of the function? You want a distinct name for
the module, otherwise this error results.

Richard


On 13 Feb, 14:11, Ron Rosenfeld <ronrosenf...@nospam.org> wrote:
> On Wed, 13 Feb 2008 05:19:01 -0800, Trent Argante
>
>
>
>
>
> <TrentArga...@discussions.microsoft.com> wrote:
> >I've written a user-defiend function, meant to be called from a cell via "=",
> >have put it in an .xla file, have loaded the .xla via Tools | Add-Ins, but it
> >is not visible to the cell unless I include the module's name. *The formula
> >box "sees" it but doesn't interact with it:

>
> > * Doesn't Work: =AverageB(rRng,sLower,sUpper).
> > * * * * * * Works: =mdlAverageB.AverageB(rRng,sLower,sUpper).

>
> >I don't think this is a coding issue, but in the following, the declarations
> >haven't been included for brevity's sake:

>
> >Public Function AverageB(rRng As Range, sLower As Single, sUpper As Single)
> >As Single
> >' TPAC.J(254).CSR():20080123W1807E:20080123w1842e
> > * For Each r In rRng
> > * * *' Standard Average for future reference - is not returned by fnc
> > * * *intCount = intCount + 1
> > * * *sglSum = sglSum + r.Value

>
> > * * *' Bound Average
> > * * *If r.Value >= sLower And r.Value <= sUpper Then
> > * * * * intAvgBCount = intAvgBCount + 1
> > * * * * sglAvgBSum = sglAvgBSum + r.Value
> > * * *End If
> > * Next

>
> > * ' Standard Average for future reference - is not returned by fnc
> > * sglAvg = sglSum / intCount 'Returns std Avg()'s value

>
> > * AverageB = sglAvgBSum / intAvgBCount
> >End Function

>
> >Grazie,

>
> I presume when you write "Tools/AddIns" that you are referring to the menu
> selection in Excel.
>
> That being the case, in my limited experience, the reason for the behaviour you
> see is that there is a naming conflict. *Perhaps there is another AverageB
> function defined in some other open Workbook.
> --ron- Hide quoted text -
>
> - Show quoted text -


 
Reply With Quote
 
Trent Argante
Guest
Posts: n/a
 
      13th Feb 2008
Ron & Richard,
Thanks for your inputs. As far as I researched, I couldn't find another
function or sub named "AverageB", but in thinking that anything starting with
"Average" was reserved, I renamed my function to "AvgBound", and it worked.
Thanks, dudes!
--
Trent Argante
[DC.J(125).CSR(105)]


"Trent Argante" wrote:

> I've written a user-defiend function, meant to be called from a cell via "=",
> have put it in an .xla file, have loaded the .xla via Tools | Add-Ins, but it
> is not visible to the cell unless I include the module's name. The formula
> box "sees" it but doesn't interact with it:
>
> Doesn't Work: =AverageB(rRng,sLower,sUpper).
> Works: =mdlAverageB.AverageB(rRng,sLower,sUpper).
>
> I don't think this is a coding issue, but in the following, the declarations
> haven't been included for brevity's sake:
>
> Public Function AverageB(rRng As Range, sLower As Single, sUpper As Single)
> As Single
> ' TPAC.J(125).CSR(105):20080123W1807E:20080123w1842e
> For Each r In rRng
> ' Standard Average for future reference - is not returned by fnc
> intCount = intCount + 1
> sglSum = sglSum + r.Value
>
> ' Bound Average
> If r.Value >= sLower And r.Value <= sUpper Then
> intAvgBCount = intAvgBCount + 1
> sglAvgBSum = sglAvgBSum + r.Value
> End If
> Next
>
> ' Standard Average for future reference - is not returned by fnc
> sglAvg = sglSum / intCount 'Returns std Avg()'s value
>
> AverageB = sglAvgBSum / intAvgBCount
> End Function
>
> Grazie,
> --
> Trent Argante
> [DC.J(125).CSR(105)]

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      13th Feb 2008
Did you have any names called AverageB--or a module named AverageB?

Trent Argante wrote:
>
> Ron & Richard,
> Thanks for your inputs. As far as I researched, I couldn't find another
> function or sub named "AverageB", but in thinking that anything starting with
> "Average" was reserved, I renamed my function to "AvgBound", and it worked.
> Thanks, dudes!
> --
> Trent Argante
> [DC.J(125).CSR(105)]
>
> "Trent Argante" wrote:
>
> > I've written a user-defiend function, meant to be called from a cell via "=",
> > have put it in an .xla file, have loaded the .xla via Tools | Add-Ins, but it
> > is not visible to the cell unless I include the module's name. The formula
> > box "sees" it but doesn't interact with it:
> >
> > Doesn't Work: =AverageB(rRng,sLower,sUpper).
> > Works: =mdlAverageB.AverageB(rRng,sLower,sUpper).
> >
> > I don't think this is a coding issue, but in the following, the declarations
> > haven't been included for brevity's sake:
> >
> > Public Function AverageB(rRng As Range, sLower As Single, sUpper As Single)
> > As Single
> > ' TPAC.J(125).CSR(105):20080123W1807E:20080123w1842e
> > For Each r In rRng
> > ' Standard Average for future reference - is not returned by fnc
> > intCount = intCount + 1
> > sglSum = sglSum + r.Value
> >
> > ' Bound Average
> > If r.Value >= sLower And r.Value <= sUpper Then
> > intAvgBCount = intAvgBCount + 1
> > sglAvgBSum = sglAvgBSum + r.Value
> > End If
> > Next
> >
> > ' Standard Average for future reference - is not returned by fnc
> > sglAvg = sglSum / intCount 'Returns std Avg()'s value
> >
> > AverageB = sglAvgBSum / intAvgBCount
> > End Function
> >
> > Grazie,
> > --
> > Trent Argante
> > [DC.J(125).CSR(105)]


--

Dave Peterson
 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      13th Feb 2008
On Wed, 13 Feb 2008 11:26:03 -0800, Trent Argante
<(E-Mail Removed)> wrote:

>Ron & Richard,
>Thanks for your inputs. As far as I researched, I couldn't find another
>function or sub named "AverageB", but in thinking that anything starting with
>"Average" was reserved, I renamed my function to "AvgBound", and it worked.
>Thanks, dudes!
>--
>Trent Argante
>[DC.J(125).CSR(105)]
>



Glad you've got it working.
--ron
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visibility =?Utf-8?B?Sm9lIEM=?= Microsoft Access Forms 1 9th Feb 2006 05:21 PM
visibility =?Utf-8?B?YWps?= Microsoft Frontpage 3 24th Jun 2005 05:45 PM
Visibility Gordon Microsoft Excel Programming 4 9th Jan 2004 08:04 PM
visibility Michael Microsoft Access Forms 2 24th Oct 2003 09:57 PM
Visibility Simon Microsoft Access 1 9th Sep 2003 02:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:44 AM.