
Running excel add-in (added into excel - not access) in Access VBA
I am sure it is possible but I don't use Excel all that much and I can see
that what you want is slightly different from the KB article. From your
description, I think you want Access to command / run a sub in the Add-In of
an Excel spreadsheet and the sub acts / formats the same spreadsheet.
What I would suggest:
1. Create a Sub in the Excel spreadsheet that use the Sub in the Add-In and
then let Access call the Sub in the spreadsheet rather than the Sub in the
Add-In.
2. Leave the Sub in the Add-In but make sure you explicitly reference
EVERYTHING and see if it works. What I meant is that a lot of method will
default the action to the ActiveDocument (Spreadsheet) but when you use
Automation, you need to specify the "ActiveDocument".
3. Add Excel Object Library to the References Collection of your Database
and move the code for the Sub to your Access Database and run the code from
Access. Unfortunately, you will have to fully reference Excel objects like
point 2 to make it work.
4. If all else fail, post the clear and precise description in relevant
Excel NGs since this has more to do with Excel than Access.
HTH
Van T. Dinh
Quote:
> Oh - so close! Only problem is my Add-In code formats a
> client's spreadsheet. So I'm looking at 3 things.
> 1) ACCESS application
> 2) Client's EXCEL data (xldata)
> 3) EXCEL XLA code to format the client's EXCEL data
> (xlFormat)
> If I open the xlFormat as specified in the article then
> I can't see the xlData
> If I open xlData
> I can't xlFormat so I open xlData and
> - Tried to used xlFormat as an add-in
> (could not get access app to see it)
> - Tried to use xlFormat as a reference
> (excel would not let me define the reference as it
> thought that would be a duplicate reference - not sure
> why?) So I couldn't tell whether or not access could call
> it.
> Thanx again!