Send a selected sheet with E-Mail from Workbook - only the print area without formulas, shortcuts and macros- in xls format

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 i want to send by e-mail.
So far so good .... but would like to send it only the 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 :sad:

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 = "Time Card - Kollege: " & GruppenName & " - Monat: " & KasseMonat & " - " & Date & Time
.Attachments.Add AWS
.Body = "Push Button and E-Mail send.." & vbCrLf & "Thx."
.Display

End With

Set OutApp = Nothing
Set Nachricht = Nothing

Me.Protect ("1234")
End Sub
------------------------------------------------------

Ps. Administrator, I am new and inexperienced, as well as English is not my native language, in case I am doing something wrong please inform me.Thx.

Thanks in Advance.

Nikko
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Status
Not open for further replies.

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

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