Daily Sales E-mail

D

D. Austin

A while back there was a post of a macro that when ran it would
automatically open Entourage and email a workbook and it used what ever was
in Cell A1 as the subject line.

I would like something similar to send my daily sales report. Except I do
not want to send the entire workbook only a range of A1:H13 and Copy and
paste it as a picture in the body of the e-mail.

I know how to create the macro to do select the range and copy, I just do
not know how to link the macro to open the application and do the e-mail
part.

Any help would be nice.
 
B

Bernard Rey

D. Austin wrote :
A while back there was a post of a macro that when ran it would
automatically open Entourage and email a workbook and it used what ever was
in Cell A1 as the subject line.

I would like something similar to send my daily sales report. Except I do
not want to send the entire workbook only a range of A1:H13 and Copy and
paste it as a picture in the body of the e-mail.

I couldn't find out how to obtain a picture. Here's a couple of lines that
will send the wanted cells in a single-sheeted, new workbook, in which
you'll get rid of the formulas and only display results. But, well, it's
still an Excel Workbook, so it'll need Excel to be read.

If I come to a better idea, I'll post again...

Sub MailARange()
MyAddress = Range("A1").Value
MySubject = Range("B1").Value
Content = Range("C1").Value
MyCurrentWB = ActiveWorkbook.Name

Workbooks.Add
ActiveWorkbook.SaveAs FileName:="SentBook"
MyNewWBName = ActiveWorkbook.FullName
Workbooks(MyCurrentWB).Activate
Range("A1:H13").Copy
Workbooks("SentBook").Activate
With ActiveSheet
.Name = "SentSheet"
.Range("A1").PasteSpecial Paste:=xlPasteFormats
.Range("A1").PasteSpecial Paste:=xlPasteValues
End With
Workbooks("SentBook").Save

MyString = "Tell application ""Microsoft Entourage""" & _
vbCr & "make new outgoing message with properties" & _
"{recipient:""" & MyAddress & """,subject:""" & MySubject & _
""",content:""" & Content & """,attachment:""" & _
MyNewWBName & """}" & vbCr & _
"move the result to out box folder" & vbCr & "send" & _
vbCr & "end tell"
MacScript MyString
Application.DisplayAlerts = False
Workbooks("SentBook").Close
Application.DisplayAlerts = True
Kill MyNewWBName
End Sub
 
S

SVEN AERTS

Is this Visual Basic of AppleScript ?


--
Sven-Brussels
GSM: +32 (0)485/389679
ExcelXv1-OSX.2.4.Jaguar-IBook-500MHz-640MB SDRAM-14GB HD-Airport-AZERTY
Keyboard
CHAT : ICQ UIN: 113835655 - YahooID: aertssven -
AOL Instant Messenger Screen Name: aertssven1 -
MSN Messenger Passport ID: (e-mail address removed)

For eco-techs & game for a better world, visit:
http://homepage.mac.com/aertssven
 
B

Bernard REY

SVEN AERTS wrote :
Is this Visual Basic of AppleScript ?

If you mean the macro that came after the quoted lines, it was a Visual
Basic macro, itself creating an AppleScript in order to send an email.

The VBA instruction to launch an AppleScipt is "MacScript".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top