ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2007 and cdo 1.2.1? (https://www.excelbanter.com/excel-programming/384279-excel-2007-cdo-1-2-1-a.html)

Mark J

Excel 2007 and cdo 1.2.1?
 
i have the following code, it worked under windows 2000 and office 2003, but
i had to upgrade server at work to windows 2003 and office 2007, now code
does not work, it tells me {.Send} is not supported. any ideas or
workarounds?

Dim NewWb As Workbook
Dim iMsg As Object
Dim WBname As String
Public Sub Process()

Sheets(Array("Moscad", "Opto")).Select

Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Sheets(Array("Moscad", "Opto")).Copy
Set NewWb = ActiveWorkbook


WBname = " " & Format(Now() - 1, "ddmmyyyy") & ".xls"
NewWb.SaveCopyAs "C:/" & WBname


Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = "Mark"" "
.Subject = "Report"
.TextBody = ""
.AddAttachment "C:/" & WBname
.Send
End With

Kill "C:/" & WBname

Set iMsg = Nothing
Set iConf = Nothing
Set wb = Nothing
Application.ScreenUpdating = True

Application.DisplayAlerts = False
Application.Quit

End Sub

Ron de Bruin

Excel 2007 and cdo 1.2.1?
 
Hi Mark

This is CDO for Windows 2000

See
http://www.rondebruin.nl/cdo.htm

You must use the commented lines in the code to fill in your smtp server and maybe a password ?

--

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


"Mark J" wrote in message ...
i have the following code, it worked under windows 2000 and office 2003, but
i had to upgrade server at work to windows 2003 and office 2007, now code
does not work, it tells me {.Send} is not supported. any ideas or
workarounds?

Dim NewWb As Workbook
Dim iMsg As Object
Dim WBname As String
Public Sub Process()

Sheets(Array("Moscad", "Opto")).Select

Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Sheets(Array("Moscad", "Opto")).Copy
Set NewWb = ActiveWorkbook


WBname = " " & Format(Now() - 1, "ddmmyyyy") & ".xls"
NewWb.SaveCopyAs "C:/" & WBname


Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = "Mark"" "
.Subject = "Report"
.TextBody = ""
.AddAttachment "C:/" & WBname
.Send
End With

Kill "C:/" & WBname

Set iMsg = Nothing
Set iConf = Nothing
Set wb = Nothing
Application.ScreenUpdating = True

Application.DisplayAlerts = False
Application.Quit

End Sub



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

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