Discussion Locked

Bad Function, Good Add-In?

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have an Add-In which has, so far, been very successful. It has always included both private f(x) & subs. I tried to add a conversion f(x):

Public Function StateTax(FindThis As String) As String
fx_StateTax = Application.WorksheetFunction.VLookup(FindThis, Worksheets("State Tax Fin Table").Range("A2:C54"), 2, True)
End Function

The "DB" the f(x), above, reads from is a sheet in the add-in; add-ins, when added, are considered hidden.

This f(x) works great when testing with the xls-backup of the addin open (& unhidden) but wont bring anything back when used from the add-in.

BTW: I need this to be called like the sum f(x) - i.e. =fx_StateTax("IA") or =fx_StateTax(cell).

email@ jbowle3@sears.com if more detail needed. Thanks.

3 replies

by glen_mcleod

I haven't done a lot of addin programming for Excel (I'm assuming it's Excel you're working with), so I don't know if it's possible, but try this:

Application.ScreenUpdating = False
'Unhide the addin, this is the part I'm not sure about
'Run your function
'Hide the addin
Application.ScreenUpdating = True

This will "freeze" Excel so that the user doesn't see the addin appearing, then "unfreeze" it when it's done.

Good luck

Glen

This discussion is closed to new replies.