Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Email error Object dosen't support this property or method

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 = ", ",
", ", ",
", ", ",
")

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email error Object dosen't support this property or method

Hi Steved

You try to save

ActiveSheet.UsedRange
instead of ActiveWorkbook(or wb)

Use it like this

Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "Sheet ....................
End With




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


"Steved" wrote in message ...
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 = ", ",
", ", ",
", ", ",
")

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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Email error Object dosen't support this property or method

Hello Ron from Steved

Ron It is highliting .SendMail of the below and is giving me a error
Invalid or unqualified reference
Please what have i got wrong thankyou.

..SendMail Addr(N), _


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", "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 = ", ",
", ", ",
", ", ",
")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "C:/Audit Reports/ Audit Summary.xls"
End With
.SendMail Addr(N), _
"Audit Summary Report"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub





"Ron de Bruin" wrote:

Hi Steved

You try to save

ActiveSheet.UsedRange
instead of ActiveWorkbook(or wb)

Use it like this

Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "Sheet ....................
End With




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


"Steved" wrote in message ...
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 = ", ",
", ", ",
", ", ",
")

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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email error Object dosen't support this property or method

Hi Steve

You must remove the End with after the SaveAs line
(there is one after the close line)

Only add this part in the original macro (example 2)
http://www.rondebruin.nl/mail/folder1/mail2.htm

With ActiveSheet.UsedRange
.Value = .Value
End With


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


"Steved" wrote in message ...
Hello Ron from Steved

Ron It is highliting .SendMail of the below and is giving me a error
Invalid or unqualified reference
Please what have i got wrong thankyou.

.SendMail Addr(N), _


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", "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 = ", ",
", ", ",
", ", ",
")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "C:/Audit Reports/ Audit Summary.xls"
End With
.SendMail Addr(N), _
"Audit Summary Report"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub





"Ron de Bruin" wrote:

Hi Steved

You try to save

ActiveSheet.UsedRange
instead of ActiveWorkbook(or wb)

Use it like this

Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "Sheet ....................
End With




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


"Steved" wrote in message ...
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 = ", ",
", ", ",
", ", ",
")

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.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Email error Object dosen't support this property or method

Hello Ron From Steved

Excellent thankyou

one question please
..SaveAs "C:/Audit Reports/ Audit Summary.xls"
can I change it to
..SaveAs "C:/Audit Reports/ dd-mm-yy.xls"

The reason is that when saved it is given a name automatically in this case
a date.


"Ron de Bruin" wrote:

Hi Steve

You must remove the End with after the SaveAs line
(there is one after the close line)

Only add this part in the original macro (example 2)
http://www.rondebruin.nl/mail/folder1/mail2.htm

With ActiveSheet.UsedRange
.Value = .Value
End With


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


"Steved" wrote in message ...
Hello Ron from Steved

Ron It is highliting .SendMail of the below and is giving me a error
Invalid or unqualified reference
Please what have i got wrong thankyou.

.SendMail Addr(N), _


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", "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 = ", ",
", ", ",
", ", ",
")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "C:/Audit Reports/ Audit Summary.xls"
End With
.SendMail Addr(N), _
"Audit Summary Report"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub





"Ron de Bruin" wrote:

Hi Steved

You try to save

ActiveSheet.UsedRange
instead of ActiveWorkbook(or wb)

Use it like this

Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "Sheet ....................
End With




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


"Steved" wrote in message ...
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 = ", ",
", ", ",
", ", ",
")

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.









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email error Object dosen't support this property or method

Hi Steve

Use this then

..SaveAs "C:/Audit Reports/" & Format(Date, "dd-mm-yy") & ".xls"



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


"Steved" wrote in message ...
Hello Ron From Steved

Excellent thankyou

one question please
.SaveAs "C:/Audit Reports/ Audit Summary.xls"
can I change it to
.SaveAs "C:/Audit Reports/ dd-mm-yy.xls"

The reason is that when saved it is given a name automatically in this case
a date.


"Ron de Bruin" wrote:

Hi Steve

You must remove the End with after the SaveAs line
(there is one after the close line)

Only add this part in the original macro (example 2)
http://www.rondebruin.nl/mail/folder1/mail2.htm

With ActiveSheet.UsedRange
.Value = .Value
End With


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


"Steved" wrote in message ...
Hello Ron from Steved

Ron It is highliting .SendMail of the below and is giving me a error
Invalid or unqualified reference
Please what have i got wrong thankyou.

.SendMail Addr(N), _


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", "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 = ", ",
", ", ",
", ", ",
")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "C:/Audit Reports/ Audit Summary.xls"
End With
.SendMail Addr(N), _
"Audit Summary Report"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub





"Ron de Bruin" wrote:

Hi Steved

You try to save

ActiveSheet.UsedRange
instead of ActiveWorkbook(or wb)

Use it like this

Set wb = ActiveWorkbook
With ActiveSheet.UsedRange
.Value = .Value
End With

With wb
.SaveAs "Sheet ....................
End With




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


"Steved" wrote in message ...
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 = ", ",
", ", ",
", ", ",
")

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.









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
runtime error 434, object does not support this method or property Janis Excel Discussion (Misc queries) 4 January 17th 08 04:10 PM
VBA error: "object doesn't support this property or method" Dave F Excel Discussion (Misc queries) 2 April 23rd 07 06:04 PM
Object doesn't support this property or method (Error 438) Kiran Excel Discussion (Misc queries) 1 July 12th 05 08:42 PM
Object doesn't support this property or method davegb Excel Programming 11 May 12th 05 03:36 PM
Run Time Error 438 - Object doesn't support the property or method Paul Cottier Excel Programming 0 September 10th 04 01:27 AM


All times are GMT +1. The time now is 03:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"