Link to home
Start Free TrialLog in
Avatar of welsh_mark
welsh_mark

asked on

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
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

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
ASKER CERTIFIED SOLUTION
Avatar of Graham Mandeno
Graham Mandeno
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of welsh_mark
welsh_mark

ASKER

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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<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>
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) :-).
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