×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

AutoExec throws error

AutoExec throws error

AutoExec throws error

(OP)
Hi,

I'm using Access 14 on a Win7 Pro box.

I have a DB (BooksRead) in the accdb format. I wanted to add a startup form to the DB. I've done this before. In fact I have another DB (WorkingDB) that utilizes the AutoExec macro to open with a form.

When I try running the BooksRead DB I get an error (the attached Word doc shows much of what I'm discussing here).

I looked at the References for both DBs and determined that the BooksRead DB did not have the Microsoft Office 14.0 Object Library. When I tried to add it to the references, it wasn't in the list. However, the WorkingDB shows it and doesn't list it as Missing. Because the Reference window is a fixed size, the actual name of the file for that reference is not readable. So when I go to the folder, I don't know which file I should be looking for.

Does anyone have any suggestions as to why the StartApp() works in the WorkingDB and not in the BooksRead DB?

Thx,
Vic

RE: AutoExec throws error

Having a reference to the library checked, you can see its path in object browser. Just open the object browser, select library, you should see the path in the bottom pane.

combo

RE: AutoExec throws error

(OP)
combo,
When I open Object Browser in the WorkingDB, I can select the OFFICE library and see the file name is MSO.DLL. But when I open the Object Browser in the BooksRead DB, there is no OFFICE library in the dropdown list.
I then decided to run procexp.exe (process explorer) from the sysinternals suite. I'd also located the MSO.DLL file as being included in the WorkingDB but not in the BooksRead DB.

So I tried to re-register the MSO.DLL using the regsvr32 command. I then got the following error msg:

The module "C:\Program Files (x86)\Common Files\microsoft shared\OFFICE14\MSO.DLL" was loaded but the entry point DllRegisterServer was not found.
Make sure that "C:\Program Files (x86)\Common Files\microsoft shared\OFFICE14" is a valid DLL or OCX file then try again.

I'm stumped.

RE: AutoExec throws error

As I understand, in WorkingDB you have reference to Office and it works. VBA in office can use Office library, excel or word have it referenced by default, but not in access. However, you should be able to add it in access via references dialog (access 2016 32 bit vba here), tick the library and accept:


Another way to add reference - point the file (browse...) in references. First, find the file and path in properly referenced vba project, next add reference (references dialog) to the file in BooksRead db:
1. References, see the library:


2. Object Browser check library path and name:


3. Return to database without reference to Office and add the reference to file in References dialog.

combo

RE: AutoExec throws error

(OP)
combo,

I don't have the Office 16.0 Object library. Doesn't show up in my references. And don't have any files in the Office16 folder. Hence, no MSO.DLL in that folder.

I'm going to try something else. I'm going to copy the form from BooksRead DB into the WorkingDB. Then I'll change the AutoExec macro to start the form from the BooksRead DB. Hopefully that will work because the references are intact. If that works, I'll clear out all the objects from the copy of the WorkingDB, copy all the other objects from the BooksRead DB into the WorkingDB and rename it.

RE: AutoExec throws error

(OP)
combo,

I actually took your suggestion and was able to navigate to the MSO.DLL in the BooksRead DB references and install it.

I made sure all the references were in the same order as those in the WorkingDB. When I reopened the BooksRead DB I still get the same error that it can't find the StartApp() function in the AutoExec macro. Now I'm really lost.

RE: AutoExec throws error

Do you have StartApp() function in the the BooksRead DB? If so is it in the same class type, with the same scope?

combo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close