Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mo Mo is offline
external usenet poster
 
Posts: 69
Default macro to email

I'm fairly new to VBE. I want to create a macro that emails sheets in a
workbook.
I am using a macro from Ron de Bruin of this community (his website). Here
is the problems I running into.

1-the sheets are not automatically emailed, I have to go into Outlook and
send. However, nothing is happening. I don't received the emails (I have a
Yahoo account).

2-The emails are not deleted after being send (I assume the macro does that).

I just want to be able to email the sheets once I click on the forms button.
I have enclosed the macro below.

Sub EmailReports()
Dim sh As Worksheet
Dim wb As Workbook
Dim strdate As String
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
If sh.Range("m1").Value Like "?*@?*.?*" Then
strdate = Format(Now, "mm--dd--yy h-mm-ss")
sh.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Sheet" & sh.Name & "of" _
& ThisWorkbook.Name & "" & strdate & ".xls"
.SendMail ActiveSheet.Range("m1").Value, _
"This is the Subject Line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
End If
Next sh
Application.ScreenUpdating = True
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default macro to email


"Mo" wrote in message
...
1-the sheets are not automatically emailed, I have to go into Outlook and
send. However, nothing is happening. I don't received the emails (I have

a
Yahoo account).


Sounds like you have a wrong email address.

2-The emails are not deleted after being send (I assume the macro does

that).

No it doesn't. It kills the file it creates, but it doesn't delete the
email. It doesn't know what mail client you are using.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default macro to email

Hi Mo

1) this is a Outlook setting, see ToolsOptions
Sending automatic in Outlook is not always working correct

See number 4
http://www.rondebruin.nl/mail/problems.htm

If the mails are in your Outbox and the address is OK it must work


2)It only delete the file with one sheet you send and not the mail


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


"Mo" wrote in message ...
I'm fairly new to VBE. I want to create a macro that emails sheets in a
workbook.
I am using a macro from Ron de Bruin of this community (his website). Here
is the problems I running into.

1-the sheets are not automatically emailed, I have to go into Outlook and
send. However, nothing is happening. I don't received the emails (I have a
Yahoo account).

2-The emails are not deleted after being send (I assume the macro does that).

I just want to be able to email the sheets once I click on the forms button.
I have enclosed the macro below.

Sub EmailReports()
Dim sh As Worksheet
Dim wb As Workbook
Dim strdate As String
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
If sh.Range("m1").Value Like "?*@?*.?*" Then
strdate = Format(Now, "mm--dd--yy h-mm-ss")
sh.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Sheet" & sh.Name & "of" _
& ThisWorkbook.Name & "" & strdate & ".xls"
.SendMail ActiveSheet.Range("m1").Value, _
"This is the Subject Line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
End If
Next sh
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
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
Email Macro John Calder New Users to Excel 6 March 25th 09 08:33 PM
How do I create an email macro to auto fill the email? Justin[_4_] Excel Discussion (Misc queries) 0 November 14th 07 10:49 PM
macro to email Mo Excel Programming 0 July 15th 05 09:09 PM
Macro To Email XLS ynissel Excel Discussion (Misc queries) 4 May 26th 05 07:12 PM


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

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"