LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Sending Mail using VBA

Hi All,

I have the below coding however it keeps returning a bug. I am adding
it to the tail end of an error trapping function. However I can't get
it working on it's own never mind at the end of the original coding.
The rest works fine, just not this bit. I want to send a newly saved
copy to a specific address, including ranges in the new saved name,
however I can't includ the date nor will it send.??

Can anyone help?

Thanks

Craig



Public Function Open_mail()


Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook

With wb
.SaveAs ThisWorkbook.Name _
& " " & strdate & Range("B13").Value & Range("B14").Value
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Credit Card Form" & Range("B13").Value &
Range("B14").Value
.Body = "This is a test... help!"
.Attachments.Add wb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
'.Display
.Send 'or use .Display
End With
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Function

 
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
General mail failure when sending e-mail from Excel Adrienne Excel Discussion (Misc queries) 5 November 4th 05 12:59 PM
Sending E-mail CB Hamlyn Excel Programming 5 July 24th 05 11:48 PM
Sending E-mail litew_8 Excel Worksheet Functions 1 November 21st 04 06:13 AM
Help sending mail... Bob Phillips[_6_] Excel Programming 1 August 12th 04 08:50 PM


All times are GMT +1. The time now is 10:55 PM.

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"