Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default how to add attachment in a CDO mail

Hi everyone, I've got a small problem.
I'd like to send my active sheet with a CDO code.
I use
.AddAttachment ThisWorkbook.ActiveSheet

but it looks like a problem
Run time erro '13'
Type-mismatch

don't really know why because it's the correct name of this sheet.

Hope to have news about that.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default how to add attachment in a CDO mail

Hi Julaf

See the examples here
http://www.rondebruin.nl/cdo.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
Hi everyone, I've got a small problem.
I'd like to send my active sheet with a CDO code.
I use
.AddAttachment ThisWorkbook.ActiveSheet

but it looks like a problem
Run time erro '13'
Type-mismatch

don't really know why because it's the correct name of this sheet.

Hope to have news about that.
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default how to add attachment in a CDO mail

Thanks Ron, I was in your website before, very instructive.
The thing is that I want to usend an active sheet from a computer without
any software.
And I use this following CDO code :

Sub CDO_Mail_Small_Text()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

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"

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

strbody = "Line 1" & vbNewLine & vbNewLine & _
"Line 2"

With iMsg
Set .Configuration = iConf
.To = "
.From = """Julaf"" "
.Subject = "Hope it works !"
.TextBody = strbody
.AddAttachment ThisWorkbook.ActiveSheet
.Send
End With

End Sub

But for the line with attachment, I've got on mismatch...

"Ron de Bruin" wrote:

Hi Julaf

See the examples here
http://www.rondebruin.nl/cdo.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
Hi everyone, I've got a small problem.
I'd like to send my active sheet with a CDO code.
I use
.AddAttachment ThisWorkbook.ActiveSheet

but it looks like a problem
Run time erro '13'
Type-mismatch

don't really know why because it's the correct name of this sheet.

Hope to have news about that.
Thanks


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default how to add attachment in a CDO mail

Download the example workbook for my page
There is a example for one worksheet

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
Thanks Ron, I was in your website before, very instructive.
The thing is that I want to usend an active sheet from a computer without
any software.
And I use this following CDO code :

Sub CDO_Mail_Small_Text()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

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"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

strbody = "Line 1" & vbNewLine & vbNewLine & _
"Line 2"

With iMsg
Set .Configuration = iConf
.To = "
.From = """Julaf"" "
.Subject = "Hope it works !"
.TextBody = strbody
.AddAttachment ThisWorkbook.ActiveSheet
.Send
End With

End Sub

But for the line with attachment, I've got on mismatch...

"Ron de Bruin" wrote:

Hi Julaf

See the examples here
http://www.rondebruin.nl/cdo.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
Hi everyone, I've got a small problem.
I'd like to send my active sheet with a CDO code.
I use
.AddAttachment ThisWorkbook.ActiveSheet

but it looks like a problem
Run time erro '13'
Type-mismatch

don't really know why because it's the correct name of this sheet.

Hope to have news about that.
Thanks


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default how to add attachment in a CDO mail

ok, but on your example, it works only if the customer have outlook.
Is it possible in your code to do the same things from a computer without
any mail software (I think about people who use an hotmail adress)

Thanks for your help.

"Ron de Bruin" wrote:

Download the example workbook for my page
There is a example for one worksheet

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
Thanks Ron, I was in your website before, very instructive.
The thing is that I want to usend an active sheet from a computer without
any software.
And I use this following CDO code :

Sub CDO_Mail_Small_Text()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

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"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

strbody = "Line 1" & vbNewLine & vbNewLine & _
"Line 2"

With iMsg
Set .Configuration = iConf
.To = "
.From = """Julaf"" "
.Subject = "Hope it works !"
.TextBody = strbody
.AddAttachment ThisWorkbook.ActiveSheet
.Send
End With

End Sub

But for the line with attachment, I've got on mismatch...

"Ron de Bruin" wrote:

Hi Julaf

See the examples here
http://www.rondebruin.nl/cdo.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
Hi everyone, I've got a small problem.
I'd like to send my active sheet with a CDO code.
I use
.AddAttachment ThisWorkbook.ActiveSheet

but it looks like a problem
Run time erro '13'
Type-mismatch

don't really know why because it's the correct name of this sheet.

Hope to have news about that.
Thanks




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default how to add attachment in a CDO mail

That's not true

Download the workbook from the CDO page
http://www.rondebruin.nl/cdo.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
ok, but on your example, it works only if the customer have outlook.
Is it possible in your code to do the same things from a computer without
any mail software (I think about people who use an hotmail adress)

Thanks for your help.

"Ron de Bruin" wrote:

Download the example workbook for my page
There is a example for one worksheet

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
Thanks Ron, I was in your website before, very instructive.
The thing is that I want to usend an active sheet from a computer without
any software.
And I use this following CDO code :

Sub CDO_Mail_Small_Text()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

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"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

strbody = "Line 1" & vbNewLine & vbNewLine & _
"Line 2"

With iMsg
Set .Configuration = iConf
.To = "
.From = """Julaf"" "
.Subject = "Hope it works !"
.TextBody = strbody
.AddAttachment ThisWorkbook.ActiveSheet
.Send
End With

End Sub

But for the line with attachment, I've got on mismatch...

"Ron de Bruin" wrote:

Hi Julaf

See the examples here
http://www.rondebruin.nl/cdo.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Julaf" wrote in message ...
Hi everyone, I've got a small problem.
I'd like to send my active sheet with a CDO code.
I use
.AddAttachment ThisWorkbook.ActiveSheet

but it looks like a problem
Run time erro '13'
Type-mismatch

don't really know why because it's the correct name of this sheet.

Hope to have news about that.
Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel e-mail attachment donwb Excel Discussion (Misc queries) 0 April 24th 08 11:45 PM
e-mail one worksheet as an attachment Marilyn Excel Discussion (Misc queries) 2 March 7th 08 09:27 PM
mail and attachment Jithu Excel Discussion (Misc queries) 1 July 9th 07 12:38 PM
E-Mail attachment to same e-mail address in Outlook Vick Excel Discussion (Misc queries) 4 May 17th 07 07:53 PM
how to e-mail with an attachment using hotmail Excel not working with hotmail Excel Worksheet Functions 0 February 6th 05 06:35 PM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"