ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trouble with emailling in XP (https://www.excelbanter.com/excel-programming/375630-trouble-emailling-xp.html)

Tim

Trouble with emailling in XP
 
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



Ron de Bruin

Trouble with emailling in XP
 
Hi Tim

Do you get a arror ?

If you test a example from my site do you have the same problem then ?
http://www.rondebruin.nl/mail/folder1/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Tim" wrote in message ...
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






All times are GMT +1. The time now is 06:13 AM.

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