Live-Forum - Die aktuellen Beiträge
Datum
Titel
17.04.2024 18:57:33
17.04.2024 16:56:58
Anzeige
Archiv - Navigation
1352to1356
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Mail in Excel nur Tabellenblatt

Mail in Excel nur Tabellenblatt
11.03.2014 12:55:52
Bommi
Hallo User !
Möchte aus Excel ein Mail senden, aber nur das aktive Tabellenblatt und nicht
die ganze Datei.
Kann mir jemand helfen ?
Vielen Dank im voraus.
Gruß Bommi

6
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Mail in Excel nur Tabellenblatt
11.03.2014 13:02:18
Klaus
Hallo Bommi,
so (mit Outlook!):
Option Explicit
'Module to send Excel-Sheet directly with outlook
'April 2013 by Klaus M.vdT.
'original Code by mumpel / www.herber.de / 11.04.2013 11:23:25
'https://www.herber.de/forum/messages/1308295.html
Sub SendExample()
'give variables to send-Makro like this!
Dim wkbThisBook As Workbook
Dim sSheet As String
Dim sText As String
Dim sTo As String
Dim sCC As String
Dim sSubject As String
Set wkbThisBook = ActiveWorkbook
sSheet = ActiveSheet.Name
sTo = "Frank Farmer ; Karl Ransaier "
sCC = ""
sText = "Dear Colleages 
find mail attached
more text" sSubject = "Todays File" Call SendSheetOutlook(wkbThisBook, sSheet, sSubject, sTo, sCC, sText) 'CALL possible in one line! 'Call SendSheetOutlook(ActiveWorkbook, "Sheet1", "Todays File", "Frank Farmer ; Karl Ransaier ", _ "", "Dear Colleages find mail attached ") End Sub Private Sub SendSheetOutlook(wkbOld As Workbook, wksOld As String, sSubject As String, sTo As _ String, sCC As String, sText As String) Dim olApp As Object Dim AWS As String Dim olSheetsCount As Integer Dim olOldBody As String 'define temporary Path and Filename AWS = wkbOld.Path & "\" & Format(Date, "YYYYMMDD") & "_" & Format(Time, "hhmmss") & "_" & _ wkbOld.Name 'remember ammount of tables for new sheet olSheetsCount = Application.SheetsInNewWorkbook 'set ammount of tables to one, so new file will not have 3-x empty tables Application.SheetsInNewWorkbook = 1 'add new empty workbook. Will be in FOCUS from now on! Workbooks.Add 'restore ammount of tables to old value Application.SheetsInNewWorkbook = olSheetsCount 'copy entire sheet wkbOld.Sheets(wksOld).Cells.Copy 'paste into new sheet as values, save sheet and close sheet under TEMP filename With ActiveWorkbook .Sheets(1).Range("A1").PasteSpecial xlPasteValues .Sheets(1).Range("A1").PasteSpecial xlPasteFormats .SaveAs Filename:=AWS, FileFormat:=xlOpenXMLWorkbookMacroEnabled .Close End With 'Make Email Set olApp = CreateObject("Outlook.Application") With olApp.CreateItem(0) .GetInspector.Display olOldBody = .htmlBody .To = sTo .cc = sCC .Subject = sSubject .htmlBody = sText & olOldBody .Attachments.Add AWS End With 'remove TEMP file Kill AWS End Sub
Grüße,
Klaus M.vdT.

Anzeige
AW: Mail in Excel nur Tabellenblatt
11.03.2014 13:06:11
Bommi
Hallo Klaus!
Nicht mit outlook, ich arbeite mit Lotus Notes.
Gruß Bommi

AW: Mail in Excel nur Tabellenblatt
11.03.2014 13:06:11
Bommi
Hallo Klaus!
Nicht mit outlook, ich arbeite mit Lotus Notes.
Gruß Bommi

Mail (LotusNotes) in Excel nur Tabellenblatt
11.03.2014 13:17:45
Klaus
Hallo Bommi,
sorry für Lotus hab ich nichts rumliegen. Gibt aber bestimmt Lösungen im Archiv (Recherche!). Ich lass den Beitrag mal offen.
Grüße,
Klaus M.vdT.

AW: E-Mail mit LotusNotes
11.03.2014 15:30:22
Bommi
Hallo !
Ist mir nicht geheuer!Maches es jetzt mit dem FreePDF Drucker. Geht auch.Müsste nur
rauskriegen wie der PDF Drucker mit VBA direkt aktiviert werden kann.
Vielen Dank für die Mühe!
Gruß Bommi

302 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige