|
-
Jan 13th, 2025, 07:39 AM
#1
Thread Starter
New Member
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
-
Jan 13th, 2025, 07:53 AM
#2
Thread Starter
New Member
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.
-
Jan 13th, 2025, 03:27 PM
#3
Addicted Member
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.
-
Jan 13th, 2025, 04:54 PM
#4
Thread Starter
New Member
Re: Cannot see Excel library in available project references
 Originally Posted by zx81sp
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?
-
Jan 14th, 2025, 06:20 AM
#5
Addicted Member
Re: Cannot see Excel library in available project references
 Originally Posted by JustNod
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....
-
Jan 14th, 2025, 11:01 AM
#6
Thread Starter
New Member
Re: Cannot see Excel library in available project references
 Originally Posted by zx81sp
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
-
Jan 14th, 2025, 03:16 PM
#7
Re: Cannot see Excel library in available project references
 Originally Posted by JustNod
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|