Excel 2007 and cdo 1.2.1?

M

Mark J

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 = "(e-mail address removed)"
.CC = ""
.BCC = ""
.From = "Mark"" <[email protected]>"
.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
 

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