ActiveX component can't create object

C

CAM

Hello,


I need help I get this error message "ActiveX component can't create
object" I am using MS Access 2002 and my users have Access 2002. I looked
in the Internet and found a possible solution, but it did not worked. I
registered DAO by going to Start, and then click Run and typed the
following:
Regsvr32 "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL",
but this doesn't seem to do anything. I have a command button that attached
file(s) to an e-mail with the correct e-mail address, which I send to my
customers. I looked to see if any references are missing, but it all looks
good. Now here is the deal I can use the program in my PC, but if I give
another user access to the program from there PC they get "ActiveX component
can't create object" error message. My program work fine, it just other
users cannot push the command button without getting an error message. I am
at my end. Can someone help me. Below is my code to run the comman button.
I don't want to spin my wheels anymore. I don't know if installing and
reinstalling will help, that seems to waste time. Thank you in advance.

Cheers


Private Sub email_Click()

On Error GoTo Err_eMail_Click
Dim sFile As String
Dim email As String
Dim ref As String
Dim PeriodFrom As String
Dim PeriodEnded As String
Dim Receiver As String
Dim When As String
Dim Who As String
Dim Bywhen As String
Dim Importance As String
Dim Reporter As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

email = txteMailRecipient
ref = "eBill from XYZ Company"
PeriodFrom = txtPeriodFrom
PeriodEnded = txtPeriodEnded
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
..To = email
..Bcc = Bcc
..Subject = ref & " "
..Body = "Attached is your e-Bill for Services from " & txtPeriodFrom & " to
" & txtPeriodEnded & " . If you have any questions regarding your bill,
please call us. Thank you." & vbCr & vbCr & "Sincerely," & vbCr & vbCr & "
Corporate Services" & vbCr & "(888) 888-8888" & vbCr & ""

..Attachments.Add "C:\CurrentBillings\Current\Billing Summary.pdf"
..End If

..Display
End With

Exit_eMail_Click:
Exit Sub

Err_eMail_Click:
MsgBox Err.Description
Resume Exit_eMail_Click

End Sub
 
A

aaron.kempf

maybe you should move to ADO so that your end users don't have to run
around, installing DLLs.

ADO has been built into every version of windows for the past 20
years, right?

DAO isnt' available (by default) with MDAC, Access or Windows, and it
hasn't been for many many many years.

ADO supports 'code reuse' so that when you grow your database- it
works against a new backend.

-Aaron
 
M

Mark Andrews

I would guess that the problem is with the line:
Set objOutlook = CreateObject("Outlook.application")
search the web to find out what DLL(s) are needed for that to work
In general Outlook being installed.
As a guess:
Microsoft Outlook 12.0 Object Library
and/or
Microsoft.Office.Interop.Outlook

On a different note why bother with using Outlook automation to send email
when you could use
a third party SMTP component to send mail. It works better and then you
know for sure the one DLL that
must be registered to send mail.

Checkout my Email module for an example.
http://www.rptsoftware.com

HTH,
Mark
 
A

aaron.kempf

or of course, if you moved to SQL Server, then you wouldn't need to
install any extra components.. you could just use XP_SendMail

or if you're in SQL 2005, then it's sp_sendDbMail I think that's the
name
 
M

Mark Andrews

It's a bit more pricey to move to SQL Server than to use a free to $50 SMTP
component. Servers, licensing fees etc.... You should probably try to
reign back a bit on the
switch to SQL Server as the answer and just give it when it fits the
situation. One of these days the REAL answer to a question will be "you
should move to sql server" but by then you will be like the story of the
little boy who cried wolf and people might not believe you (even though you
are giving the right answer).

Just a thought?

Mark (a fan of SQL Server AND Access)



or of course, if you moved to SQL Server, then you wouldn't need to
install any extra components.. you could just use XP_SendMail

or if you're in SQL 2005, then it's sp_sendDbMail I think that's the
name
 
T

Tony Toews [MVP]

CAM said:
I need help I get this error message "ActiveX component can't create
object" I am using MS Access 2002 and my users have Access 2002. I looked
in the Internet and found a possible solution, but it did not worked. I
registered DAO by going to Start, and then click Run and typed the
following:
Regsvr32 "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL",
but this doesn't seem to do anything.

Very doubtful that it would as your problem is caused by Outlook.
I have a command button that attached
file(s) to an e-mail with the correct e-mail address, which I send to my
customers.

Do your users have a different version of Outlook than you do? For
example are you on Outlook 2007? If so you want to use Late Binding.

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.

This also is very useful when you don't know version of the external
application will reside on the target system. Or if your organization
is in the middle of moving from one version to another.

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/
 
T

Tony Toews [MVP]

maybe you should move to ADO so that your end users don't have to run
around, installing DLLs.

Aaron, please reread the posting in detail. His problem has nothing
to do with DAO.

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/
 
C

CAM

First of all I want to say Thank you for all the advice and comments by all
the professionals who helped me. I was able to resolve the matter what I
did was; Install MS Access 2007 trial from the Internet I was able to use
the form with the specific command button when I ran my program. I later
unstalled the the MS Access 2007 and re-opened the my program pushed the
command button and it works great. I believe and I can be wrong there was a
particular dll file (outlook) that was needed. Again Thanks for all the
help, comments, advice.

Cheers
 
A

aaron.kempf

SQL Server is free-- where do you come up with this shit?
using XP_SmtpMail, it's a SQL Extended Stored Procedure that works on
any version of SQL Server.

-Aaron
 
A

aaron.kempf

SQL Server is easier dev-- cheaper-- than Jet, because it doesn't blow
up every other day.
If you want a simple database-- that supports multiple users-- then
everyone for every database-- should choose SQL Server.

SQL Server = write once run anywhere.

Jet isn't supported, it's not avaliable, it's not reliable..
it's depecrated and it has no future.

-Aaron
 
T

Tony Toews [MVP]

A

aaron.kempf

the _WORD_ is depecrated?

ROFL

so you have _ZERO_ replication capabilities.. and you have _ZERO_
security capabilities.. and they renamed the database architecture..
and you think that _JET_ is still relevent, _WHY_?

Because you're too stupid to learn SQL -- now you're going to get
force fed a layer of sharepoint in between jet and SQL Server
Because you're too stupid to learn SQL -- now you're going to get
force fed a layer of sharepoint in between jet and SQL Server
Because you're too stupid to learn SQL -- now you're going to get
force fed a layer of sharepoint in between jet and SQL Server
 

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