Excel Add-ins

S

Stuart

I am opening an Excel spreadsheet in VBA. This is being
done through Automation from Access.

When the spreadsheet is opened the add-in 'Analysis
Toolpak' is turned on.

However, i cannot use functions of this add-in, such as
Weeknum.

Any Ideas?

Rgds

Stuart
 
D

Dave Peterson

This worked ok for me (but from MSWord):
Option Explicit
Sub testme01()

Dim xlobj As Object

Set xlobj = CreateObject("excel.application")
xlobj.Visible = True

xlobj.AddIns("analysis toolpak").Installed = False
xlobj.AddIns("analysis toolpak").Installed = True

'do your stuff

xlobj.Quit
Set xlobj = Nothing

End Sub

It shows up in the tools|Addins list, but isn't really loaded. You can see that
it's not there in the VBE (if you make the application visible and go into the
VBE.
 

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