A challenge for the Excel Experts among us (ActiveX Control & Add-ins)

J

JMMach

Hello Ladies & Gentlemen,
1. Is there a way in Excel 2000 thru to Excel 2003 to take an ActiveX
control (MSCAL.OCX) and attach it to a project as an Add-in?
What are the procedures for doing this.
Or at the very least I would like to put a copy of that file into a folder
that I specify, and when the Excel file requiring that ActiveX is opened,
use the Open event to make sure that the reference of that ActiveX points to
my specified folder. What would be the code that accomplishes this.
By way of background, what led to this question is an Excel project (Excel
file automated with VBA) file that used the MSCAL.OCX control on a UserForm.
Then came the day when the user got a new computer, and when the form was
opened the Calendar control just vanished. I determined that MSCAL.OCX was
missing from her workstation. I was able to get the OCX file, put it on her
workstation, and restore the UserForm from a backup copy in a zipped file.
But I want to avoid such a problem in the future.

2. Does anyone know if a list of the common reference libraries used by
Excel exists, and more importantly, along with the list are details of the
contents of such libraries. For example, the Analysis Toolpak is one Add-in
that is common, but I have not been able to find any document that tells me
what functions it contains. And knowing that would be very helpful.

Are these questions too tough, or will someone rise to the challenge.
Thanks in advance.
TTFN
JMMach
 
T

Tom Ogilvy

You can't easily embed a file in a workbook. You can distribute the file
with your workbook and have the code in your workbook check if it already
exists and if not, copy it to the users computer and register it.

You can use the shell command:

Windows 95: regsvr32.exe \windows\system\mscal.ocx

Windows NT: regsvr32.exe \windows\system32\mscal.ocx



Load the Analysis Toolpak - VBA, then in the VBE, select it in the Object
Viewer and look at the functions within.
 
J

JMMach

Thank Tom, I appreciate the quick response.
You answered a lot of questions in your brief answer.
Looks like distributing the file and checking is my answer.
Do you have the code for checking the existence of such a file? Would you
check the registry and the physical location, or just the physical location?
Thanks for your help.
TTFN
JMMach
 
B

Bob Phillips

dir(filepathandname)<>""

returns true if the file exists

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
J

JMMach

Thanks Bob,
Appreciate it.
TTFN
JMMach

Bob Phillips said:
dir(filepathandname)<>""

returns true if the file exists

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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