VBA compile problem

Status
Not open for further replies.

Akula

Well-known member
17,428
When I have a user try the following code
code:<HR>
Code:
   Debug.Print "Entering iSendEmail"
    Set dbsdatabase = CurrentDb
    Set objOutlook = CreateObject("Outlook.Application")        'Create the Outlook session

(that looks messy) they get the following error:

Compile error:
Object library feature not supported

Unfortunately MSDN isn't of much help. Here is the user's situation.

They were previously using Win2K Pro + Office 2000 (Access 2000) and it worked just fine. Now they're using XP Pro + Office XP with Office XP tools, but Access 2000.

Any clues?
 

Akula

Well-known member
17,428
Well, upgrading to Access XP fixed it apparenly.

But...

Now a question...Their VBA/AccessDB uses Outlook to send mass mailings to internal customers. Unfortunately, OXP has the security feature of requesting a time limit for the application to access Outlook as well as a "click yes per email sent" process.

Any way to programmatically get around that without creating your own SMTP engine? I'm going to look on MSDN in a minute...
 

Coleman

Ars Legatus Legionis
16,790
Subscriptor
Yes, do as Erorus suggests. Don't create an instance of Outlook just to send emails. It's a lot of extra over head. Use the CDONTS libraries instead. I think they'll run faster too, and they are designed to be handled programatically so you won't have interface problems like the one you are running into with Outlook.
Read up on MSDN about CDO. It shouldn't be any harder to do email that way then how you are doing it with Outlook.
-J
 

wb

Ars Legatus Legionis
25,208
Subscriptor
Is it just those 3 lines of code? There's absolutely no other code there?

Try commenting out the Debug.Print.

CreateObject shouldn't ever return that kind of error message, nor should the "set" line.

Anyway what line does the compiler say it's on? If you're using the standard VBA editor in "debug" mode it should go right to the line (usually) that's causing the error. Or, you can set a breakpoint and step through the code to find out which line is the culprit.
 

Akula

Well-known member
17,428
Well, no, it isn't the only lines of code.....just the one the compiler stopped on, and IIRC it stopped on the last one.

But the CDO stuff should do it as we're now not running into problems using Access XP, but are running into the "click yes to send every message" thing in Outlook XP.

In reality, this isn't my problem...But being in the position I am, I just volentered to find information to fix/bypass the problem. CDO will definately do that...Thank god I don't have to learn it :)
 
Status
Not open for further replies.