typelib for Excel 2003

Posted on 2006-05-15
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
    LVL 44

    Accepted Solution

    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
    LVL 1

    Author Comment

    Hi bruintje,

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

    LVL 44

    Expert Comment

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

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    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…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now