Emailing A Workbook As An Attachment

Morrissey

Board Regular
Joined
Mar 8, 2002
Messages
85
Hi, I have recently made an invoice template for my freight forwarding company and I would like to send it as workbook attachment on an E-mail using MS outlook when I click a button, however this is the tricky part on this invoice template I have buttons I woukld like to have the Invoice saved as an attachment without the buttons if it helps my invoice is on the following cells A1 to G49

Can someone help me please I really need to find out how to do this very quickly and don't have time to learn visual basic!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try this

Sub sendsheet1()
'Declare String
Dim sAddress As String
'Initialise the string with the address entered into box
sAddress = InputBox("Please enter the name of the recipient" & vbCr & "CONVENTION = firstname . surname@thiscompany.co.uk", "Send To")

'If the user doesn't enter an address then exit the sub.
If sAddress = "" Then Exit Sub
' SELECT THE SHEET NAME
Sheets("site 1").Select ' change name
Range(Range("A1"), Range("g49").End(xlUp)).Select
Selection.Copy
' if you have multi formatted colums etc ( ie various widths etc) then it is better to create a blank master and load that and then paste to that
Workbooks.Add
' paste the selection
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SendMail Recipients:=sAddress, Subject:="site 1 cost pro", ReturnReceipt:=False
MsgBox "Your email has been sent to" & vbCr & sAddress & vbCr & "", , "MESSAGE"
ActiveWindow.Close
' at this point select no to msgbox and then swithback to original sheet
Sheets("printing").Select ' change name
Range("A1").Select
End Sub
This message was edited by keithkemble on 2002-03-12 13:24
 
Upvote 0

Forum statistics

Threads
1,214,567
Messages
6,120,268
Members
448,953
Latest member
Dutchie_1

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