Error RunTime Access 2000 with the Office 2003

C

Carlos Henrique

Good Morning.

I have the application development in Access 2000 and that one function that
connection a Excel.

I created a query that use the data this excel worksheet and it relate with
others tables Access

Inside the application i use query in the form in the Access. This
functioned with the
RunTime in the Access 2000 and Office 2000.

My company changed the softwares for Windows XP, Office 2003 and it
maintained the RunTime of the Access 2000. After this, the application began
it give the following error:

Erro: "the expression may not result in the name of a macro , the name of a
user-definition function "

It installing the Access 2000 the error does not occur, but it installing
the RunTime of the Access 2003 the error occur too.

Someone has some suggestion for me help?

Carlos Henrique
Brazil
 
T

Tony Toews [MVP]

Carlos Henrique said:
Erro: "the expression may not result in the name of a macro , the name of a
user-definition function "

Your Access app contains a reference to Excel 2000. Once your
company installed Office 2003 that reference broke.

The simple solution is to change the reference to Excel 2003. This
assumes that everyone who uses your app is now on Office 2003.

The better solution is to remove the reference and use late binding.
Then it won't matter what version of Excel folks have installed on
their system. Or even if they don't have Excel installed at all.

Late binding means you can safely remove the reference and only have
an error when the app executes lines of code in question. Rather than
erroring out while starting up the app and not allowing the users in
the app at all. Or when hitting a mid, left or trim function call.

You'll want to install the reference if you are programming or
debugging and want to use the object intellisense while in the VBA
editor. Then,. once your app is running smoothly, remove the
reference and setup the late binding statements.

Sample code:
' Declare an object variable to hold the object
' reference. Dim as Object causes late binding.
Dim objWordDoc As Object
Set objWordDoc = CreateObject(" Word.Document")

For more information including additional text and some detailed links
see the "Late Binding in Microsoft Access" page at
http://www.granite.ab.ca/access/latebinding.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top