ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sending Email using CDO ERROR (https://www.excelbanter.com/excel-programming/282702-sending-email-using-cdo-error.html)

Todd Huttenstine[_2_]

Sending Email using CDO ERROR
 
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes. I kept
getting the same error on each code I tried to use. see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd

Ron de Bruin

Sending Email using CDO ERROR
 
Hi Todd

Do you read this?

http://www.rondebruin.nl/cdo.htm#Problems

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine" wrote in message ...
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes. I kept
getting the same error on each code I tried to use. see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd




Ron de Bruin

Sending Email using CDO ERROR
 
Afer reading again

Do you use Windows 2000 or Windows XP Todd???

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in message ...
Hi Todd

Do you read this?

http://www.rondebruin.nl/cdo.htm#Problems

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine" wrote in message ...
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes. I kept
getting the same error on each code I tried to use. see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd






Todd Huttenstine[_2_]

Sending Email using CDO ERROR
 
I use windows 2000 here at work. I will be using 2000 for
the majority anyway.

I read the Problems section and I still cant figure out
what my problem is because I keep getting the debug
error. And when I click debug this is whats
highlighted. Set iMsg = CreateObject("CDO.Message").

The code I used this time was...
Private Sub CommandButton1_Click()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant
Dim WB As Workbook
Dim WBname As String
Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed use
'Set WB = ThisWorkbook
WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"
WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "smtp.something.nl"
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
' You can add any file you want with
'.AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True


End Sub





-----Original Message-----
Afer reading again

Do you use Windows 2000 or Windows XP Todd???

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in message

...
Hi Todd

Do you read this?

http://www.rondebruin.nl/cdo.htm#Problems

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine"

wrote in message
...
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes. I

kept
getting the same error on each code I tried to use.

see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code

is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-

mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a

Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd





.


Ron de Bruin

Sending Email using CDO ERROR
 
= "smtp.something.nl"

Did you change the server to yours in the code when you test it

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine" wrote in message ...
I use windows 2000 here at work. I will be using 2000 for
the majority anyway.

I read the Problems section and I still cant figure out
what my problem is because I keep getting the debug
error. And when I click debug this is whats
highlighted. Set iMsg = CreateObject("CDO.Message").

The code I used this time was...
Private Sub CommandButton1_Click()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant
Dim WB As Workbook
Dim WBname As String
Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed use
'Set WB = ThisWorkbook
WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"
WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "smtp.something.nl"
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
' You can add any file you want with
'.AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True


End Sub





-----Original Message-----
Afer reading again

Do you use Windows 2000 or Windows XP Todd???

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in message

...
Hi Todd

Do you read this?

http://www.rondebruin.nl/cdo.htm#Problems

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine"

wrote in message
...
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes. I

kept
getting the same error on each code I tried to use.

see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code

is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-

mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a

Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd




.




Todd Huttenstine[_2_]

Sending Email using CDO ERROR
 
yes I believe I did it correctly. Here are the lines
fromt hat part of the code:

.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "SCGVLEXMB03"
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25


-----Original Message-----
= "smtp.something.nl"

Did you change the server to yours in the code when you

test it

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine"

wrote in message news:059701c3ac91$0cac4e00
...
I use windows 2000 here at work. I will be using 2000

for
the majority anyway.

I read the Problems section and I still cant figure out
what my problem is because I keep getting the debug
error. And when I click debug this is whats
highlighted. Set iMsg = CreateObject

("CDO.Message").

The code I used this time was...
Private Sub CommandButton1_Click()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant
Dim WB As Workbook
Dim WBname As String
Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed use
'Set WB = ThisWorkbook
WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"
WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item

("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2
.Item

("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "smtp.something.nl"
.Item

("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
' You can add any file you want with
'.AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True


End Sub





-----Original Message-----
Afer reading again

Do you use Windows 2000 or Windows XP Todd???

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in

message
...
Hi Todd

Do you read this?

http://www.rondebruin.nl/cdo.htm#Problems

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine"

wrote in message
...
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes.

I
kept
getting the same error on each code I tried to use.

see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code

is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set

a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the

code
is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy

h-
mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a

Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete

the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd




.



.


Ron de Bruin

Sending Email using CDO ERROR
 
Hi Todd

As far as I know is CDO a part of Win 2000.
If you fill in the Server name correct it must work.

I only have Win XP running on this moment but I will install Win 2000 also this week.
If I have problems I will add it to the CDO page in the problems section.


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine" wrote in message ...
yes I believe I did it correctly. Here are the lines
fromt hat part of the code:

.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "SCGVLEXMB03"
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25


-----Original Message-----
= "smtp.something.nl"

Did you change the server to yours in the code when you

test it

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine"

wrote in message news:059701c3ac91$0cac4e00
...
I use windows 2000 here at work. I will be using 2000

for
the majority anyway.

I read the Problems section and I still cant figure out
what my problem is because I keep getting the debug
error. And when I click debug this is whats
highlighted. Set iMsg = CreateObject

("CDO.Message").

The code I used this time was...
Private Sub CommandButton1_Click()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant
Dim WB As Workbook
Dim WBname As String
Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed use
'Set WB = ThisWorkbook
WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"
WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item

("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2
.Item

("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "smtp.something.nl"
.Item

("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
' You can add any file you want with
'.AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True


End Sub





-----Original Message-----
Afer reading again

Do you use Windows 2000 or Windows XP Todd???

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in

message
...
Hi Todd

Do you read this?

http://www.rondebruin.nl/cdo.htm#Problems

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine"
wrote in message
...
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes.

I
kept
getting the same error on each code I tried to use.
see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code

is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set

a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the

code
is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy

h-
mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a
Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete

the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd




.



.




David

Sending Email using CDO ERROR
 
You need to be on W2000 and you need valid email
addresses and an smtp which recognises your email. It
does work


-----Original Message-----
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes. I

kept
getting the same error on each code I tried to use. see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd
.


Fiona[_5_]

Sending Email using CDO ERROR
 
I think CDO is part of Windows 2000 Server. You have to execute code on a
machine that is set up as a server. The large company I work for has
standardized on ASPQMail as a way to send email. They have removed the CDO
object from the production servers.

When I develop something where I want to send email I first do it with CDO
on a test server I have set up that is stock Microsoft. When I have it
working I do it over so it works with ASPQMail on a production server. I use
CDO first because there is lots of documentation on the web.

In both cases I have to refer to the correct Exchange Server to get it to
work.

Most of my background is with VBScript so I don't know if this applies here.

Regards

"Ron de Bruin" wrote in message
...
Hi Todd

As far as I know is CDO a part of Win 2000.
If you fill in the Server name correct it must work.

I only have Win XP running on this moment but I will install Win 2000 also

this week.
If I have problems I will add it to the CDO page in the problems section.


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine" wrote in message

...
yes I believe I did it correctly. Here are the lines
fromt hat part of the code:

.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "SCGVLEXMB03"
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25


-----Original Message-----
= "smtp.something.nl"

Did you change the server to yours in the code when you

test it

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine"

wrote in message news:059701c3ac91$0cac4e00
...
I use windows 2000 here at work. I will be using 2000

for
the majority anyway.

I read the Problems section and I still cant figure out
what my problem is because I keep getting the debug
error. And when I click debug this is whats
highlighted. Set iMsg = CreateObject

("CDO.Message").

The code I used this time was...
Private Sub CommandButton1_Click()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant
Dim WB As Workbook
Dim WBname As String
Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed use
'Set WB = ThisWorkbook
WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"
WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item

("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2
.Item

("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "smtp.something.nl"
.Item

("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
' You can add any file you want with
'.AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True


End Sub





-----Original Message-----
Afer reading again

Do you use Windows 2000 or Windows XP Todd???

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in

message
...
Hi Todd

Do you read this?

http://www.rondebruin.nl/cdo.htm#Problems

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Todd Huttenstine"
wrote in message
...
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes.

I
kept
getting the same error on each code I tried to use.
see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code

is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set

a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the

code
is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy

h-
mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a
Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete

the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd




.



.






Jake Marx[_3_]

Sending Email using CDO ERROR
 
Todd,

That sounds like a CDO installation/configuration error. Here's a link that
may help (watch line wrap):

http://groups.google.com/groups?hl=e...3DN%26tab%3Dwg

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Todd Huttenstine wrote:
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes. I kept
getting the same error on each code I tried to use. see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd



Ron de Bruin

Sending Email using CDO ERROR
 
Hi Jake

This looks like the problem.
I hope we hear from Todd

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Jake Marx" wrote in message ...
Todd,

That sounds like a CDO installation/configuration error. Here's a link that
may help (watch line wrap):


http://groups.google.com/groups?hl=e...3DN%26tab%3Dwg

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Todd Huttenstine wrote:
http://www.rondebruin.nl/cdo.htm#sheet

I went to the above site and tried various codes. I kept
getting the same error on each code I tried to use. see
error below....

"Run-Time error '-2147024770(8007007e)':
Automation error
The specified module could not be found."

When I click debug, the following part of the code is
highlighted.

" Set iMsg = CreateObject("CDO.Message")"

Here is the entire code below.

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a
reference
' It is not working in Windows 98 and ME.
' You must be online when you run the sub

Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is
placed you must use
'Set WB = ThisWorkbook

WBname = WB.Name & " " & Format(Now, "dd-mm-yy h-mm-
ss") & ".xls"

WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date
and Time stamp

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want
with .AddAttachment "C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the
file you send delete this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub


Any ideas?

Thanx
Todd






All times are GMT +1. The time now is 02:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com