Loading...

excel-macros@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: $$Excel-Macros$$ macro for excel data to email NOORAIN ANSARI Mon Feb 20 09:01:49 2012

Dear Amit,

Please try it..

Sub maildata()
Dim a As Workbook
Dim data As Range
Set data = ThisWorkbook.Sheets(1).UsedRange
data.Copy
Set a = Workbooks.Add
a.Sheets(1).Cells(1, 1).Select
ActiveSheet.Paste
MsgBox ThisWorkbook.Path
a.SaveAs ThisWorkbook.Path & "Automatic_ Email.xls"
a.Close
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim SigString As String
Dim Signature As String


Application.ScreenUpdating = False
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "[EMAIL PROTECTED]"
.CC = "[EMAIL PROTECTED]"
 .Subject = "Incoming Status!"
.Body = "Messages " & vbCrLf & vbCrLf & " Thanks " & vbCrLf & "Regards" &
vbCrLf & " Noorain Ansari"
.Attachments.Add ThisWorkbook.Path & "Automatic_ Email.xls"
.Send
 End With

Set olMail = Nothing
'Kill ThisWorkbook.Path & "\abc1.xls"
End Sub

See attached sheet..


On Mon, Feb 20, 2012 at 9:00 PM, Amit Desai (MERU)
<[EMAIL PROTECTED]>wrote:

>  Dear Friends,****
>
> ** **
>
> Is there any macro for sending excel data to emails of different vendors?*
> ***
>
> ** **
>
> Best Regards,****
>
> Amit****
>
> ** **
>
> ------------------------------
> Disclaimer: This message and its attachments contain confidential
> information and may also contain legally privileged information. This
> message is intended solely for the named addressee. If you are not the
> addressee indicated in this message (or authorized to receive for
> addressee), you may not copy or deliver any part of this message or its
> attachments to anyone or use any part of this message or its attachments.
> Rather, you should permanently delete this message and its attachments (and
> all copies) from your system and kindly notify the sender by reply e-mail.
> Any content of this message and its attachments that does not relate to the
> official business of Meru Cab Company Pvt. Ltd. must be taken not to have
> been sent or endorsed by any of them. Email communications are not private
> and no warranty is made that e-mail communications are timely, secure or
> free from computer virus or other defect.
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to [EMAIL PROTECTED]
>



-- 
Thanks & regards,
Noorain Ansari
 ** <http://excelmacroworld.blogspot.com/>*http://noorainansari.com/*
*http://excelmacroworld.blogspot.com/*<http://excelmacroworld.blogspot.com/>

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to [EMAIL PROTECTED]