Help!! User-defined type not defined?

  • Thread starter Thread starter bradharlow
  • Start date Start date
B

bradharlow

Guest
I have created some simple VBA code to send an email to our parent company on a daily basis. It has worked like a charm for he past ten months.

Today I am geting an eror message stating User-defined type not defined and the following statement is highlighted:

Dim olookApp As Outlook.Application

For some reason it is now acting like Outlook is not a defined application. We have upgraded PC's in the past couple of weeks but we still use Access 2000.

Any suggestions would be greatly apreciated.
 
It is probably a missing reference. Sometimes they just quit working for what seems like no apparent reason.

Open or create a new module and then choose Tools from the file menu. Under References look to see if one of them says missing. If so check it and close the app. After it reopens everything should be fine again.
 
If that doesn't highlight the problem write down all of the checked references and the file location, then uncheck all of the reference that you can (some you can't uncheck), compile and exit the module, reenter the module, reselect the appropriate references, compile and save and everything should be ok. There is a known bug that sometimes Access loses a reference even though it is not marked as "Missing".

Autoeng
 
Thanks. The reference was missing. No one knows how it happened but when I checked the outlook reference the program worked again.

Thanks a lot
 

Users who are viewing this thread

Back
Top Bottom