Results 1 to 7 of 7

Thread: Cannot see Excel library in available project references

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    8

    Cannot see Excel library in available project references

    Hi

    I am trying to resurrect an old VB6 project on a new server but I am hitting a problem with some of its Excel related functionality and, in particular, the "Save As" (HTML) functionality which is generating an error in the HTML "This page uses frames, but your browser doesn't support them".

    As this project is still active and working on an old server, as a first step, I thought I'd install Excel 2003 (as used on that server) on the newer machine I'm testing on. However, my next step is to go into the project and change the reference from "Microsoft Excel 14.0 Object Library" to "Microsoft Excel 11.0 Object Library" but the latter is not showing in the available references. I assumed it would appear followingf the Excel 2003 install. I aslo tried running the Excel EXE with /regserver switch but that had no effect.

    I am aware that Excel v14 (Excel 2010) is also pretty old but I know the same logic is failing on another machine with a relatively current version of Excel.

    Any help as to how I can resolvge this problem would be greatly appreciated.

    Many thanks.
    Last edited by JustNod; Jan 13th, 2025 at 07:44 AM. Reason: Typo

  2. #2

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    8

    Re: Cannot see Excel library in available project references

    Ah, solved it. I had to remove the Excel 14 reference, close the references dialog, re-open it, then browse to the Excel 2003 executable and add it. Apologies for any time wasted.

  3. #3
    Addicted Member
    Join Date
    Aug 2023
    Posts
    201

    Re: Cannot see Excel library in available project references

    Don't use references to Excel or any other Office products, instead of use objects, with this you will not have problems compiling your projects even if you don't have office installed.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    8

    Re: Cannot see Excel library in available project references

    Quote Originally Posted by zx81sp View Post
    Don't use references to Excel or any other Office products, instead of use objects, with this you will not have problems compiling your projects even if you don't have office installed.
    Thanks but I don'y really understand - what are you suggesting as an alternative in the case of Excel 2003?

  5. #5
    Addicted Member
    Join Date
    Aug 2023
    Posts
    201

    Re: Cannot see Excel library in available project references

    Quote Originally Posted by JustNod View Post
    Thanks but I don'y really understand - what are you suggesting as an alternative in the case of Excel 2003?
    You can add to your project a reference (for example) to Excel 11.0 and use this code:

    Code:
    Dim excapp As Excel.Application
    Dim exdoc As Excel.Workbook
    Set excapp = CreateObject("Excel.Application")
    Set exdoc = excapp.Workbooks.Open(App.Path & "\Book1.xls")
    Or you can do the same without using any reference in your project:

    Code:
    Dim exapp As object
    Dim exdoc As object
    Set exapp = createObject("Excel.Application")
    Set exdoc= exapp.Worksheets....

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    8

    Re: Cannot see Excel library in available project references

    Quote Originally Posted by zx81sp View Post
    You can add to your project a reference (for example) to Excel 11.0 and use this code:
    Ah I see, thank you for spelling it out for me. I will give that a go but, if I have 2 versions of Excel installed how would I distinguish between the two please?
    Last edited by JustNod; Jan 14th, 2025 at 11:06 AM. Reason: Adding question

  7. #7
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,969

    Re: Cannot see Excel library in available project references

    Quote Originally Posted by JustNod View Post
    Ah I see, thank you for spelling it out for me. I will give that a go but, if I have 2 versions of Excel installed how would I distinguish between the two please?
    You won't have intellisense while you are debugging in IDE using that method. But it is easy to go back and forth. Just an fyi
    Please remember next time...elections matter!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width