Autoexec macro - error on RunCode (1 Viewer)

Adeptus

What's this button do?
Local time
Today, 12:09
Joined
Aug 2, 2006
Messages
300
(edit: forgot to say, I'm using Access 2003)
I have an Autoexec macro that uses RunCode to call a VBA function.
It works fine on one PC, in MDB or MDE.
On another PC I'm trying to run it on, it works fine as a MDB but gives an error when I open the MDE version:
"The expression you entered has a function name that Microsoft Office Access can't find"

I have tried making the function Public, but that has no effect.

If I convert it (MDB to MDE) on the second PC, it will run, but I don't have the code-signing certificate set up on that PC, and shouldn't have to just to get it working! :mad:

edit: just had an idea... tried putting the function call in a form's OnLoad, and having that form open on startup instead of the macro... still doesn't work. Brings up a different error:
"the expression on load you entered as the event property setting produced the following error:
requested type library or wizard is not a vba project.

* the expression may not result in the name of a macro, the name of a user-defined function, or [event procedure].
* there may have been an error evaluating the function, event, or macro."
 
Last edited:

gavinjb

Registered User.
Local time
Today, 03:39
Joined
Mar 23, 2006
Messages
39
Hi,

I sometimes have a simular error and it usually is missing references on the PC. Try opening VBA and opening references option screen and seeing if any thing has missing in there. If it does you will need to copy the libraries and use regsvr32 to register them.
 

Adeptus

What's this button do?
Local time
Today, 12:09
Joined
Aug 2, 2006
Messages
300
If that was the case I'd expect the MDB to give errors as well?

All the references are there, not sure if they're at the same paths... will check it out.

edit: paths are all the same. One reference has the filename capitalised on one PC and not the other, but that shouldn't matter.
 
Last edited:

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 03:39
Joined
Sep 12, 2006
Messages
15,660
I 've got general errors like that, when it was just something silly like tables not being connected properly, especially in a newly distributed app.

One problem is, is that depending on how the error handling is constructed, an issue may not produce an error until it causes a knock on effect somewhere else, and as a reult you get cryptic and misleading error messages.

If you compile the mdb on machine 2 to an mde with no errors, it seems to indicate that there is something wrong with the other mde on machine 2. You're not using a desktop icon to launch an old (and therefore not updated) version of your mde are you. I've had issues like that as well.
 

Adeptus

What's this button do?
Local time
Today, 12:09
Joined
Aug 2, 2006
Messages
300
Nope, doubleclicking the MDE file directly.

Cryptic and misleading error messages... I did try installing the MDE on several PCs with only the Access runtime, before I came across the error on this PC.
They would start the MDE successfully, then give an error later when an event fired.
I had assumed it was a missing reference, and since it was an MDE & runtime, I couldn't directly check for broken references.
I found some code to list all references, but then ran into this other error, so haven't tried it on the runtime PCs.
 

Users who are viewing this thread

Top Bottom