Send selected sheet via E-Mail, only the print area without formulas, shortcuts and macros.

Status
Not open for further replies.

Nikko

Board Regular
Joined
Nov 26, 2018
Messages
73
Hi all
,
have a small workbook created as a working time card which you can send by e-mail.
So far so good .... but would like to send it only then selected worksheet and not the whole workbook, and if possible only the print area without formulas, shortcuts and macros.


With this code I get only the whole workbook in the mail :-(

Can someone help me there with the vba code?

VBA Code:
------------------------------------------------------
Sub Excel_Workbook_via_Outlook_Senden()
Me.Unprotect ("1234")
Dim Nachricht As Object, OutApp As Object
Dim GruppenName, KasseMonat As String
Set OutApp = CreateObject("Outlook.Application")
Dim AWS As String
AWS = ThisWorkbook.FullName
ActiveSheet.UsedRange.Copy
Cells(1).PasteSpecial xlPasteValues

GruppenName = ThisWorkbook.Sheets("Januar").Range("I3")

KasseMonat = Month(CDate(ThisWorkbook.Sheets("Januar").Range("B1"))) & "/" & Year(CDate(ThisWorkbook.Sheets("Januar").Range("B1")))
Set Nachricht = OutApp.CreateItem(0)
With Nachricht
.To = "Abrechnung@mail.de"
.Subject = "Abrechnung - Kollege: " & GruppenName & " - Monat: " & KasseMonat & " - " & Date & Time
.Attachments.Add AWS
.Body = "Bitte Drücke auf Senden und die E-Mail wird automatisch gesendet." & vbCrLf & "Vielen Dank."
.Display

End With

Set OutApp = Nothing
Set Nachricht = Nothing
MsgBox "Dont Forget!!!" & vbNewLine & "Print Sheet", vbInformation, "Be Friend"
Me.Protect ("1234")
End Sub
------------------------------------------------------

Thanks in Advance.

Nikko
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Status
Not open for further replies.

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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