typelib for Excel 2003

Posted on 2006-05-15
Medium Priority
Last Modified: 2012-08-13
I'm sitting here in Access and have automated Excel objects using the reference C:\Program Files\Microsoft Office\Office\Excel9.OLB which is a type library. Everything works nicely with that typelib.

My client has Office 2003.  Shamefully, I do not.

If I ship the Excel9.OLB which works so nicely here with the app I am developing (the .mdb), I betcha when it gets to his PC with Office 2003 it won't work.  The first thing which will happen is it won't find an implementation of Excel interfaces in C:\Program Files\Microsoft Office\Office\ because doesn't the Office 2003 version live in C:\Program Files\Office10\Excel.exe.

It looks like last time I did this kind of thing I gave the client an .mdb with a reference to C:\Program Files\Office10\Excel.exe which I guess has the typelib built into the .exe.

Will that work again?  I want to be saved the embarrassment.
Question by:supportoranges
  • 2
LVL 44

Accepted Solution

bruintje earned 500 total points
ID: 16681328
Hello supportoranges,

then it would be Office11 in the path but what if the client installed in a different directory?
why not use late binding and do away with all the linked in references altogether

you can remove the reference to the typelib and use code like

    Dim objExcel As Object
    Dim objWorkBook As Object
    Set objExcel = CreateObject("EXCEL.APPLICATION")
    Set objWorkBook = objExcel.Workbooks.Open("C:\test\test.xls")
    objWorkBook.Close True
    Set objWorkBook = Nothing
    Set objExcel = Nothing

the real difference is that you do not have intellisense and use as object for the needed excel objects, but you could build a production version and a developer one with references and intellisense.

yes i admit this is maybe not needed and a bit of work but it saves you the headaches you experience now and in the future

hope this helps a bit

Author Comment

ID: 16681425
Hi bruintje,

Yes, thank you.  It's been a while.  That's a good solution.

LVL 44

Expert Comment

ID: 16681486
glad it serves your purpose, thanks for the grade :)

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month17 days, 3 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question