S
Steved
Hello from Steved
Before I made the changes below it worked fine.
The error message is "Object dosen't support this property or method"
I made 2 changes to below
1 is to ask the worksheet to change to values.
2 to save file.
Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
.SaveAs "Sheet " & Shname(N) _
& " " & strdate & "C:/Audit Reports/ Audit Summary.xls"
Sub Mail_test()
Dim wb As Workbook
Dim strdate As String
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
strdate = Format(Now, "dd-mm-yy")
Shname = Array("Summary all Depots", "City Depot (1)", "Roskill Depot
(2)", "Papakura Depot (3)", "Wiri Depot (4)", "Shore Depot (5)", "Orewa Depot
(6)", "Swanson Depot (7)", "Panmure Depot (8)")
Addr = Array("(e-mail address removed)", "(e-mail address removed)",
"(e-mail address removed)", "(e-mail address removed)", "(e-mail address removed)",
"(e-mail address removed)", "(e-mail address removed)", "(e-mail address removed)",
"(e-mail address removed)")
Application.ScreenUpdating = False
For N = LBound(Shname) To UBound(Shname)
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
.SaveAs "Sheet " & Shname(N) _
& " " & strdate & "C:/Audit Reports/ Audit Summary.xls"
.SendMail Addr(N), _
"Audit Summary Report"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub
Thankyou.
Before I made the changes below it worked fine.
The error message is "Object dosen't support this property or method"
I made 2 changes to below
1 is to ask the worksheet to change to values.
2 to save file.
Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
.SaveAs "Sheet " & Shname(N) _
& " " & strdate & "C:/Audit Reports/ Audit Summary.xls"
Sub Mail_test()
Dim wb As Workbook
Dim strdate As String
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
strdate = Format(Now, "dd-mm-yy")
Shname = Array("Summary all Depots", "City Depot (1)", "Roskill Depot
(2)", "Papakura Depot (3)", "Wiri Depot (4)", "Shore Depot (5)", "Orewa Depot
(6)", "Swanson Depot (7)", "Panmure Depot (8)")
Addr = Array("(e-mail address removed)", "(e-mail address removed)",
"(e-mail address removed)", "(e-mail address removed)", "(e-mail address removed)",
"(e-mail address removed)", "(e-mail address removed)", "(e-mail address removed)",
"(e-mail address removed)")
Application.ScreenUpdating = False
For N = LBound(Shname) To UBound(Shname)
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
.SaveAs "Sheet " & Shname(N) _
& " " & strdate & "C:/Audit Reports/ Audit Summary.xls"
.SendMail Addr(N), _
"Audit Summary Report"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub
Thankyou.