add-in question

L

ljb

I have written an add-in with a function that needs to be triggered by a
Worksheet_Change event. Can I put the event code in the add-in and have it
available to new worksheets? If not how do I call a function in the add-in
from my new worksheet? I've tried

Private Sub Worksheet_Change(ByVal Target As Range)
GetColors Target
End Sub

but Excel doesn't seem to know where to find GetColors.

thanks
LJB
 
L

ljb

I found part of my answer. The only question now is how to include and
reference an even function in an add-in?

Private Sub Worksheet_Change(ByVal Target As Range)
Application.Run "'my lookup.xla'!getcolors", Target
End Sub

LJB
 
D

Dave Peterson

If your addin has a nice unique project name (not VBAProject), then you can open
the other workbook and with that project active, tools|references and point at
the addin.

Then you can call "getcolors" just like it's a built in VBA function.

(Were you using reference in this sense?)
 

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