Q
Qaspec
heres the code i was using. Yesterday it worked perfectly. I have the email
in my inbox to prove it. Today when i use it i get this error. Run Time Error
1004 Application defined or object defined error. I haven't changed a thing
in the file.
Private Sub Send2_Click()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.Sheets(1).Name = .Sheets(1).Range("B4").Value
.SaveAs .Sheets(1).Range("B4").Value _
& ".xls"
ActiveWorkbook.SendMail "", _
"Inactive Employee Attendance Data"
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close False
End With
End Sub
Thanks for the help.
in my inbox to prove it. Today when i use it i get this error. Run Time Error
1004 Application defined or object defined error. I haven't changed a thing
in the file.
Private Sub Send2_Click()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.Sheets(1).Name = .Sheets(1).Range("B4").Value
.SaveAs .Sheets(1).Range("B4").Value _
& ".xls"
ActiveWorkbook.SendMail "", _
"Inactive Employee Attendance Data"
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close False
End With
End Sub
Thanks for the help.