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 challenge

Hello from Steved

I would like to email A worksheet called To Depots and Value the cells in
that workbook

I'm Getting a complie error

method or data member not found

This is where itbis highlighting .Name_

Please help Thankyou.

Sub Mail_Todepot()
Dim wb As Workbook
Dim strdate As String

strdate = Format(Now, "dd-mm-yy")

Application.ScreenUpdating = False

Sheets("To Depot").Copy
ActiveSheet.Copy
Cells.Copy
Cells.PasteSpecial xlPasteValues
Cells(1).Select
Worksheets(1).Select
Application.CutCopyMode = False

With wb
.SaveAs "Part of" & ThisWorkbook.Name_

& " "& strdate &"C:/To Depots/Kilometres.xls"

.SendMail ",_
"Kilometres Per Bus"

.ChangeFileAccessxlReadOnly
Kill.FullName

.Close False
End With

Application.ScreenUpdating = True
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Email challenge

Hi Steve,

With wb


wb has not been set to any workbook.

Try replacing this line with:

Set wb = ActiveWorkbook
With wb

---
Regards,
Norman



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

I would like to email A worksheet called To Depots and Value the cells in
that workbook

I'm Getting a complie error

method or data member not found

This is where itbis highlighting .Name_

Please help Thankyou.

Sub Mail_Todepot()
Dim wb As Workbook
Dim strdate As String

strdate = Format(Now, "dd-mm-yy")

Application.ScreenUpdating = False

Sheets("To Depot").Copy
ActiveSheet.Copy
Cells.Copy
Cells.PasteSpecial xlPasteValues
Cells(1).Select
Worksheets(1).Select
Application.CutCopyMode = False

With wb
.SaveAs "Part of" & ThisWorkbook.Name_

& " "& strdate &"C:/To Depots/Kilometres.xls"

.SendMail ",_
"Kilometres Per Bus"

.ChangeFileAccessxlReadOnly
Kill.FullName

.Close False
End With

Application.ScreenUpdating = True
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Email challenge

Thanks Norman

"Norman Jones" wrote:

Hi Steve,

With wb


wb has not been set to any workbook.

Try replacing this line with:

Set wb = ActiveWorkbook
With wb

---
Regards,
Norman



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

I would like to email A worksheet called To Depots and Value the cells in
that workbook

I'm Getting a complie error

method or data member not found

This is where itbis highlighting .Name_

Please help Thankyou.

Sub Mail_Todepot()
Dim wb As Workbook
Dim strdate As String

strdate = Format(Now, "dd-mm-yy")

Application.ScreenUpdating = False

Sheets("To Depot").Copy
ActiveSheet.Copy
Cells.Copy
Cells.PasteSpecial xlPasteValues
Cells(1).Select
Worksheets(1).Select
Application.CutCopyMode = False

With wb
.SaveAs "Part of" & ThisWorkbook.Name_

& " "& strdate &"C:/To Depots/Kilometres.xls"

.SendMail ",_
"Kilometres Per Bus"

.ChangeFileAccessxlReadOnly
Kill.FullName

.Close False
End With

Application.ScreenUpdating = True
End Sub





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
A challenge doss04 New Users to Excel 0 October 22nd 08 08:03 AM
Challenge OwenGiryluk Excel Worksheet Functions 10 October 1st 07 10:33 PM
hyperlink email challenge brendan Excel Discussion (Misc queries) 11 October 18th 05 09:08 AM
Who is up for a challenge? Jambruins Excel Discussion (Misc queries) 2 April 12th 05 08:23 PM
Challenge DB100[_2_] Excel Programming 1 May 6th 04 05:38 PM


All times are GMT +1. The time now is 09:27 AM.

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

About Us

"It's about Microsoft Excel"