ARA - How do I e-mail an excel based Invoice??

Peter_Koski

New Member
Joined
Feb 24, 2002
Messages
3
Hi All
I work for an International freight forwarding company and we have Outlook and Outlook Express installed. To save printing out the invoice and faxing it I would like to e-mail it directly from my PC to the client as so many now have internet access.

Is it possible ???!!!

If so HOW??

Your help much appreciated

Regards

Peter
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Save your file, then.

Believe it or not, there's a little envelope icon on your toolbar.

Also, File-Send to-Email recipient. And may I strongly suggest you always send as an attachment?
 
Upvote 0
Try

Sub SendEmail()

Dim aOutlook As Outlook.Application, aEmail As Outlook.MailItem

On Error Resume Next

Set aOutlook = GetObject(, "Outlook.Application")

If aOutlook Is Nothing Then Set aOutlook = New Outlook.Application

On Error GoTo 0

If aOutlook Is Nothing Then

MsgBox "Microsoft Outlook is not installed."

Else

Set aEmail = aOutlook.CreateItem(olMailItem)

aEmail.Subject = "Latest figures"

aEmail.Body = "The figures do not include the last two days of trading."

aEmail.Attachments.Add ThisWorkbook.Path & "data01.xls"

aEmail.Recipients.Add "email@address.com"

On Error GoTo lNoSend

aEmail.Send

MsgBox "Email successfully sent."

End If

Exit Sub

lNoSend:

MsgBox "Email not sent."

End Sub
or

Sub SendEmailNR()

Dim aOutlook As Object, aEmail As Object

On Error Resume Next

Set aOutlook = GetObject(, "Outlook.Application")

On Error GoTo lNoOutlook

If aOutlook Is Nothing Then Set aOutlook = CreateObject("Outlook.Application")

Set aEmail = aOutlook.CreateItem(olMailItem)

On Error GoTo 0

aEmail.Subject = "Latest figures"

aEmail.Body = "The figures do not include the last two days of trading."

aEmail.Attachments.Add ThisWorkbook.Path & "data01.xls"

On Error GoTo lNoSend

aEmail.Recipients.Add "bigman@hotmail.com"

aEmail.Send

MsgBox "Email successfully sent."

Exit Sub

lNoSend:

MsgBox "Email not sent."

Exit Sub

lNoOutlook:

MsgBox "Microsoft Outlook is not installed."

End Sub
This message was edited by brettvba on 2002-03-11 16:35
 
Upvote 0
With your invoice open click on the visual basic editor or alt+f11. Highlight your project and click insert>module, then paste this code:

Sub SendIt()
Application.Dialogs(xlDialogSendMail).Show _
arg1:="email@address.com", _
arg2:="Invoice name"
End Sub

(arg1 will be the default address, when outlook opens you can change who receives the invoice.)

Then close the editor and on your invoice add a command button and set its caption to "Click to send invoice".

Right click on the command button and click view code. Then paste this code:

Dim Pw As String

Pw = InputBox("Enter Password")
If Pw = "Whatever you want as password" then SendIt:End
If Pw <> "Your password above" Then
MsgBox ("Incorrect Password, cannot send mail")
End If

The above code will prevent others from sending the invoice without your knowledge.
(Just make sure to right click on your project file, click on vbaproject properties,and enter a password under the protection so others cannot view your code.

Save your workbook and click the button.


HTH

Viper
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,243
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top