Runtime MS access 2007 running acess app 2003 - missing or broken reference to excel.exe error

I have a runtime access 2007 licence, i installed on a laptop. I have then converted an access 2003 db to Access 2007. When i try to open up the database using the runtime licence, i get an error Missing or Broken reference to Excel.exe.

The user is running exel 2002.

Any ideas guys
welsh_markAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peter57rCommented:
Access will not adjust references to prior versions for non-Access object libraries.

Either you replicate the user's config during your development or else you switch from early to late binding in your code, so that you don't set a reference at all.  Note that once you switch to late binding you will get no Intellisense on Excel objects and none of the standard Excel constants will be recognised.  So you will either need to use their numeric values instead or (better) set up your own constants with the names you have already used in your code.
See here for an example of late binding..
http://www.vb123.com/kb/index.html?200507_ds_excel.htm
0
GrahamMandenoCommented:
Further to what Peter has said, I have an easy technique for switching between early- and late-binding.  This gives me all the advantages of intellisense and syntax checking during development, and eliminates version problems on distribution.
The trick is to put a compiler constant at the top of your module:
#Const EarlyBinding = 1
Then, in your code, wherever you declare Excel (/Word/Outloook etc) objects, you use a construction like this:
#If EarlyBinding Then
Debug.Assert xlCenter = -4108
Debug.Assert xlHairline = 1
Dim oXL As Excel.Application
Dim oWkb As Excel.Workbook
Dim oSht As Excel.WorkSheet
Dim oRng As Excel.Range
#Else
Const xlCenter = -4108
Const xlHairline = 1
Dim oXL As Object
Dim oWkb As Object
Dim oSht As Object
Dim oRng As Object
#End If
In the #If EarlyBinding section, each object is declared as the actual object in the referenced object library, while in the #Else section, the save variables are declared "As Object".
Also, every Const declaration in the #Else section is mirrored by a Debug.Assert in the #If EarlyBinding section.  This ensures, during development, that you are using the correct values for all your constants.
When the time comes to deploy your app, simply remove the reference and change #Const EarlyBinding to 0.
--
Graham
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
welsh_markAuthor Commented:
Hi Im a bit lost, Im just trying to open the database in a runtime licence in access 2007 when ive converted an access 2003 to access 2007, when i open it i get the error, I havent tried to write any code etc.

so unsure what the earl;y or late binding is, forgive my ignorance im not a programmer just be handed it and told to get on with it.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

GrahamMandenoCommented:
If YOU did the conversion from Access 2003 to 2007 then you ARE the programmer :-)
You should be able to fix it by deleting the reference to "Microsoft Excel 11.0 Object Library" and adding one to  "Microsoft Excel 12.0 Object Library".
What we have been suggesting is a way to make your database run on any computer with Excel installed, no matter what the version.
Try reading the VB123 article and use my conditional compilation idea to make life even easier.
--
Graham
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
<off topic>
Graham - that one is going in the ToolKit! Thanks for that, I use Early binding and then switch over all the time, and it never occured to me to use compiler directives.

Scott
</off topic>
0
welsh_markAuthor Commented:
Hi Graham,

Dont tell my boss im a programmer he will expect me to do all sorts of techie black magic then.
Im now going to show my complete ignorance, where do i put that code ( polite answers pls) :-).
0
GrahamMandenoCommented:
Well, first you undo your belt ... only kidding! :-D
Somewhere in your code, probably in the function(s) that does stuff with Excel, there must be some declarations like:
     Dim <something> As Excel.<something>
That is where you put the #If EarlyBinding - just before the Dim ... As Excel.... lines.
Then, just after those Dim statements, put the #Else and #End If.  Between them, copy and paste all the lines from above, and change all the "As Excel....." to "As Object"
At the very top of your module, put the #Const declaration:
#Const EarlyBinding = 1
Remember to set the reference (Tools>References) to whatever version of the Excel object library is on your computer.
And, Scott: It's all yours - glad you find it useful :-)
--
Graham
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.