Hello,
I have a piece of code that automatically saves and send a file. However this code works fine in Excel 2000 - 2007 but doesn't work in Excel 97.
Does anyone know how to fix this problem?
Thank you in advance.
DitzySuz
Sub SaveandSend()
ThisFile = Range("C6").Value
ThisFile1 = Range("C5").Value
ThisFile2 = Range("C3").Value
ActiveWorkbook.SaveAs Filename:="Survey - " & ThisFile & ThisFile1 & ThisFile2
'Working in 2000-2007
'This example send the last saved version of the Activeworkbook
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = "lees6@anz.com"
.Subject = "BM Survey"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Configuration: Windows XP Internet Explorer 6.0