View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Error send mail with CDO

No, not in the same way. Excel can only keep the "live" link between two
open books if they are open by the same user on the same workstation. You
could, of course (if allowed) open the 2nd workbook in shared mode and update
it frequently. Other than that Excel will only be able to read what is in
the saved file, not the open workbook on the other machine.
--
- K Dales


"JKing" wrote:

Hy:

When i try to send email with this code i get a error "the message could not be sent to the smtp server"
Run-time error 2147220975 (80040211) The transport error code was 0x80040217
Software in use Microsoft Excel 2003 and windows xp.

Windows 2000 and office 2000 configuration no problems.

Thanks
Paulo



Private Sub EnvEmailControl()


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

Application.ScreenUpdating = False
Set WB = ActiveWorkbook
WBname = WB.Name
WB.SaveCopyAs "C:\" & WBname
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Anyone"" <xxxx"
.Subject = Range("L3").Value
.TextBody = "book"
.AddAttachment "C:\" & WBname
.Send ' error on this comand

End With
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = False


End Sub