Trouble with emailling in XP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been using this email macro for three years on our system without any
problems. We have using Windows 2000, but the newer computers we have
purchased are running XP. The macro works fine with the 2000 computers, but
falls down on the XP systems @ ActiveWorkbook.SendMail "data", _ Fullname

Here is what I have.

' Macro makes a copy of this sheet, takes incident number and surname
' creates a date and time string, saves active sheet using inc.# and surname
' and emails this sheet.


Sub Mail_ActiveSheet()
Dim strdate As String
Dim FName1, FName2, Fullname
FName1 = Range("AU2").Value & "-"
FName2 = Range("I4").Value
Fullname = FName1 & FName2
ActiveSheet.Copy
strdate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")
ActiveSheet.SaveAs "this Sheet for " & Fullname _
& " " & strdate & ".xls"
ActiveWorkbook.SendMail "data", _
Fullname
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.Fullname
ActiveWorkbook.Close False
End Sub
 
Back
Top