Note: The other languages of the website are Google-translated. Back to English
Se connecter  \/ 
x
or
x
Inscrivez-vous  \/ 
x

or

Comment envoyer une feuille de calcul uniquement via Outlook à partir d'Excel?

Si vous souhaitez envoyer par courrier électronique une seule feuille de calcul à partir d'un classeur dans Excel via Outlook, vous pouvez envoyer la feuille de calcul en tant que pièce jointe, en tant que contenu du corps ou en tant que fichier PDF. Mais existe-t-il des moyens plus rapides pour vous de résoudre ce problème dans Excel?

Envoyer une feuille de calcul unique en tant que corps d'Excel avec la commande Envoyer au destinataire du courrier

Envoyer une seule feuille de calcul en tant que pièce jointe à partir d'Excel avec le code VBA

Envoyer une seule feuille de calcul sous forme de fichier PDF à partir d'Excel avec le code VBA


flèche bleue bulle droite Envoyer une feuille de calcul unique en tant que corps d'Excel avec la commande Envoyer au destinataire du courrier

Excel nous aide à envoyer par courrier électronique la feuille de calcul active en tant que contenu du corps à l'aide de la commande Envoyer au destinataire du courrier. Vous pouvez faire comme suit:

Si vous utilisez Excel 2007, 2010 ou 2013, vous devez ajouter ceci Envoyer au destinataire du courrier commande à la Barre d'outils d'accès rapide d'abord.

1. Cliquez sur l'icône du Personnaliser la barre d'outils Accès rapideet choisissez Plus de commandes, voir capture d'écran:

doc-email-sheet1

2. Et dans le Options Excel boîte de dialogue, choisissez Commandes absentes du ruban et Choisissez les commandes dans liste déroulante, puis sélectionnez le Envoyer au destinataire du courrier option, et cliquez Ajouter >> bouton pour ajouter cette commande, au dernier clic OK pour enregistrer ce paramètre. Voir la capture d'écran:

doc-email-sheet2

3. Le produit Envoyer au destinataire du courrier commande a été insérée dans le Barre d'outils d'accès rapide, voir capture d'écran:

doc-email-sheet3

4. Cliquez ensuite sur ceci Envoyer au destinataire du courrier bouton icône, et une boîte de dialogue apparaît, dans le Courriel boîte de dialogue, cochez Envoyer la feuille actuelle comme corps du messageEt cliquez OK. Voir la capture d'écran:

doc-email-sheet4

5. Et une zone d'édition de courrier électronique est affichée au-dessus des données de la feuille de calcul, vous pouvez entrer vos destinataires, sujet et introduction dans la zone de texte correspondante. Voir la capture d'écran:

doc-email-sheet5

6. Puis clique Envoyez cette Sheet pour envoyer cette feuille de calcul active comme corps de message à votre personne spécifique.


flèche bleue bulle droite Envoyer une seule feuille de calcul en tant que pièce jointe à partir d'Excel avec le code VBA

Si vous souhaitez envoyer par courrier électronique la feuille de calcul active en tant que pièce jointe, le code VBA suivant peut vous rendre service.

1. Activez votre feuille de calcul que vous souhaitez envoyer.

2. Maintenez le ALT + F11 clés, et il ouvre le Fenêtre Microsoft Visual Basic pour Applications.

3. Cliquez insérer > Moduleet collez le code suivant dans le Fenêtre du module.

Code VBA: envoyer la feuille de calcul actuelle en tant que pièce jointe à partir d'Excel

Sub SendWorkSheet()
'Update 20131209
Dim xFile As String
Dim xFormat As Long
Dim Wb As Workbook
Dim Wb2 As Workbook
Dim FilePath As String
Dim FileName As String
Dim OutlookApp As Object
Dim OutlookMail As Object
On Error Resume Next
Application.ScreenUpdating = False
Set Wb = Application.ActiveWorkbook
ActiveSheet.Copy
Set Wb2 = Application.ActiveWorkbook
Select Case Wb.FileFormat
Case xlOpenXMLWorkbook:
    xFile = ".xlsx"
    xFormat = xlOpenXMLWorkbook
Case xlOpenXMLWorkbookMacroEnabled:
    If Wb2.HasVBProject Then
        xFile = ".xlsm"
        xFormat = xlOpenXMLWorkbookMacroEnabled
    Else
        xFile = ".xlsx"
        xFormat = xlOpenXMLWorkbook
    End If
Case Excel8:
    xFile = ".xls"
    xFormat = Excel8
Case xlExcel12:
    xFile = ".xlsb"
    xFormat = xlExcel12
End Select
FilePath = Environ$("temp") & "\"
FileName = Wb.Name & Format(Now, "dd-mmm-yy h-mm-ss")
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
Wb2.SaveAs FilePath & FileName & xFile, FileFormat:=xFormat
With OutlookMail
    .To = "skyyang@extendoffice.com"
    .CC = ""
    .BCC = ""
    .Subject = "kte features"
    .Body = "Please check and read this document."
    .Attachments.Add Wb2.FullName
    .Send
End With
Wb2.Close
Kill FilePath & FileName & xFile
Set OutlookMail = Nothing
Set OutlookApp = Nothing
Application.ScreenUpdating = True
End Sub

Notes: Dans le code ci-dessus, vous pouvez modifier les informations suivantes selon vos propres besoins.

  • .To = "skyyang @extendoffice.com "
  • .CC = ""
  • .BCC = ""
  • .Subject = "fonctionnalités kte"
  • .Body = "Veuillez vérifier et lire ce document."

4. Puis clique F5 clé pour exécuter ce code, et une boîte de dialogue apparaîtra, cliquez sur Permettre lorsque la barre de progression est terminée et que la feuille de calcul actuelle a été envoyée à votre destinataire en tant que pièce jointe.

doc-email-sheet6


flèche bleue bulle droite Envoyer une seule feuille de calcul sous forme de fichier PDF à partir d'Excel avec le code VBA

Parfois, vous devez envoyer votre rapport de feuille de calcul à d'autres personnes, mais vous ne voulez pas que d'autres le modifient. Dans ce cas, vous pouvez envoyer la feuille de calcul sous forme de fichier PDF à partir d'Excel.

1. Activez votre feuille de calcul que vous souhaitez envoyer.

2. Maintenez le ALT + F11 clés, et il ouvre le Fenêtre Microsoft Visual Basic pour Applications.

3. Cliquez insérer > Moduleet collez le code suivant dans le Fenêtre du module.

Code VBA: envoyer la feuille de calcul actuelle sous forme de fichier PDF à partir d'Excel

Sub SendWorkSheetToPDF()
'Update 20131209
Dim Wb As Workbook
Dim FileName As String
Dim OutlookApp As Object
Dim OutlookMail As Object
On Error Resume Next
Set Wb = Application.ActiveWorkbook
FileName = Wb.FullName
xIndex = VBA.InStrRev(FileName, ".")
If xIndex > 1 Then FileName = VBA.Left(FileName, xIndex - 1)
FileName = FileName & "_" + ActiveSheet.Name & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
With OutlookMail
    .To = "skyyang@extendoffice.com"
    .CC = ""
    .BCC = ""
    .Subject = "kte features"
    .Body = "Please check and read this document."
    .Attachments.Add FileName
    .Send
End With
Kill FileName
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub

Remarque: Dans le code ci-dessus, vous pouvez modifier les informations suivantes selon vos besoins.

  • .To = "skyyang @extendoffice.com "
  • .CC = ""
  • .BCC = ""
  • .Subject = "fonctionnalités kte"
  • .Body = "Veuillez vérifier et lire ce document."

4. Puis appuyez F5 clé, et une boîte de dialogue apparaîtra, cliquez sur Permettre après la fin de la barre de progression, la feuille de calcul active a été envoyée à la personne spécifique sous forme de fichier PDF.

doc-email-sheet6

Notes:

1. Ces méthodes ne sont disponibles que lorsque vous utilisez Outlook comme programme de messagerie.

2. Après avoir envoyé la feuille de calcul actuelle, vous pouvez accéder à votre Outlook pour vous assurer que l'e-mail a bien été envoyé.


Créer une liste de diffusion puis envoyer des e-mails

Le produit Kutools pour Excel's Créer une liste de diffusion et d' Envoyez Emails Les utilitaires peuvent créer rapidement une liste de diffusion dans une feuille de calcul, puis envoyer le même sujet, le même contenu et les mêmes pièces jointes à plusieurs adresses e-mail.
liste de diffusion doc 1
doc flèche vers le bas
liste de diffusion doc 2

Articles Liés:

Comment envoyer le classeur actuel via Outlook à partir d'Excel?

Comment envoyer / envoyer par e-mail une plage de cellules via Outlook à partir d'Excel?


Les meilleurs outils de productivité de bureau

Kutools for Excel résout la plupart de vos problèmes et augmente votre productivité de 80%

  • Réutilisation: Insérer rapidement formules complexes, graphiques et tout ce que vous avez utilisé auparavant; Crypter les cellules avec mot de passe; Créer une liste de diffusion et envoyer des e-mails ...
  • Barre Super Formula (modifiez facilement plusieurs lignes de texte et de formule); Disposition de lecture (lire et modifier facilement un grand nombre de cellules); Coller dans la plage filtrée...
  • Fusionner les cellules / lignes / colonnes sans perdre de données; Contenu des cellules divisées; Combiner des lignes / colonnes en double... Empêcher les cellules en double; Comparer les gammes...
  • Sélectionnez Dupliquer ou Unique Lignes; Sélectionnez les lignes vides (toutes les cellules sont vides); Super Find et Fuzzy Find dans de nombreux classeurs; Sélection aléatoire ...
  • Copie exacte Plusieurs cellules sans changer la référence de formule; Créer automatiquement des références à plusieurs feuilles; Insérer des puces, Cases à cocher et plus encore ...
  • Extrait du texte, Ajouter du texte, Supprimer par position, Supprimer l'espace; Créer et imprimer des sous-totaux de pagination; Conversion entre le contenu et les commentaires des cellules...
  • Super filtre (enregistrer et appliquer des schémas de filtrage à d'autres feuilles); Tri avancé par mois / semaine / jour, fréquence et plus; Filtre spécial par gras, italique ...
  • Combiner des classeurs et des feuilles de travail; Fusionner les tableaux en fonction des colonnes clés; Diviser les données en plusieurs feuilles; Conversion par lots xls, xlsx et PDF...
  • Plus de 300 fonctionnalités puissantes. Prend en charge Office / Excel 2007-2019 et 365. Prend en charge toutes les langues. Déploiement facile dans votre entreprise ou organisation. Essai gratuit de 30 jours. Garantie de remboursement de 60 jours.
onglet kte 201905

Office Tab apporte une interface à onglets à Office et simplifie considérablement votre travail

  • Activer l'édition et la lecture par onglets dans Word, Excel, PowerPoint, Publisher, Access, Visio et Project.
  • Ouvrez et créez plusieurs documents dans de nouveaux onglets de la même fenêtre, plutôt que dans de nouvelles fenêtres.
  • Augmente votre productivité de 50% et réduit des centaines de clics de souris chaque jour!
bas de cabine
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Bhattacharjee · 1 years ago
    This is to inform you that i have an VBA code for send email from outlook with the help of excel vba,now i want to put "MDD Code" & " MDD Name" as well as Cells(i, 1) & Cells(i, 2) in a table like that.

    MDD Code MDD Name
    M123 Joydip

    I am sending you the VBA Code,Request you for help.
    VBA Code
    ----------------------------------------------------------------------------------------------------------------------------------------------
    Sub sendmail()

    Dim olapp As Outlook.Application

    Dim olmail As Outlook.MailItem

    For i = 2 To 35

    Application.ScreenUpdating = False

    Set olapp = New Outlook.Application

    Set olmail = olapp.CreateItem(olMailItem)

    With olmail

    olmail.To = Cells(i, 4).Value

    olmail.CC = Cells(i, 6).Value

    olmail.Subject = Cells(i, 7).Value

    olmail.HTMLBody = "Dear Partner ," & _

    "
    Please find the attchment." & _

    "

    MDD Code : " & Cells(i, 1) & _

    "
    MDD Name : " & Cells(i, 2) & _

    "






    Joydip Bhattacharjee" & _

    "
    Company" & _

    "
    MIS" & _

    "
    Country" & _

    "
    Contact No : 7602066491"







    olmail.Attachments.Add Cells(i, 8).Value

    'On Error Resume Next

    'olmail.Attachments.Add Cells(i, 9).Value

    'On Error Resume Next

    'olmail.Attachments.Add Cells(i, 10).Value

    'On Error Resume Next

    'olmail.Attachments.Add Cells(i, 11).Value

    'On Error Resume Next

    'olmail.Attachments.Add Cells(i, 12).Value

    'On Error Resume Next

    'olmail.Attachments.Add Cells(i, 13).Value

    'On Error Resume Next

    'olmail.Attachments.Add Cells(i, 14).Value

    'On Error Resume Next

    olmail.Send

    End With

    Set olmail = Nothing

    Next

    End Sub
  • To post as a guest, your comment is unpublished.
    mehmet · 2 years ago
    merhaba ben bunu belirli periyotta otomatik mail atmasını nasıl ayarlayabilirim
  • To post as a guest, your comment is unpublished.
    Oscar Eseisa · 3 years ago
    Excelent code. Thanks!
  • To post as a guest, your comment is unpublished.
    Dave · 3 years ago
    Anyway I can easily send an excel worksheet through my outlook without all this ?? I can send the worksheet context, but no the workbook as an attachment. On my work computer I can send from word and excel, but am having trouble at home.
  • To post as a guest, your comment is unpublished.
    Richard · 3 years ago
    Hi! Is it possible to use this code, but instead of sending straight away it opens up the mail?
    • To post as a guest, your comment is unpublished.
      Sunny · 3 years ago
      You can try this code:
      Sub SendWorkSheet()
      'Update 20180109
      Dim xFile As String
      Dim xFormat As Long
      Dim Wb As Workbook
      Dim Wb2 As Workbook
      Dim FilePath As String
      Dim FileName As String
      Dim OutlookApp As Object
      Dim OutlookMail As Object
      On Error Resume Next
      Application.ScreenUpdating = False
      Set Wb = Application.ActiveWorkbook
      ActiveSheet.Copy
      Set Wb2 = Application.ActiveWorkbook
      Select Case Wb.FileFormat
      Case xlOpenXMLWorkbook:
      xFile = ".xlsx"
      xFormat = xlOpenXMLWorkbook
      Case xlOpenXMLWorkbookMacroEnabled:
      If Wb2.HasVBProject Then
      xFile = ".xlsm"
      xFormat = xlOpenXMLWorkbookMacroEnabled
      Else
      xFile = ".xlsx"
      xFormat = xlOpenXMLWorkbook
      End If
      Case Excel8:
      xFile = ".xls"
      xFormat = Excel8
      Case xlExcel12:
      xFile = ".xlsb"
      xFormat = xlExcel12
      End Select
      FilePath = Environ$("temp") & "\"
      FileName = Wb.Name & Format(Now, "dd-mmm-yy h-mm-ss")
      Set OutlookApp = CreateObject("Outlook.Application")
      Set OutlookMail = OutlookApp.CreateItem(0)
      Wb2.SaveAs FilePath & FileName & xFile, FileFormat:=xFormat
      With OutlookMail
      .To = "skyyang@extendoffice.com"
      .CC = ""
      .BCC = ""
      .Subject = "kte features"
      .Body = "Please check and read this document."
      .Attachments.Add Wb2.FullName
      .Display
      ' .Send
      End With
      Wb2.Close
      Kill FilePath & FileName & xFile
      Set OutlookMail = Nothing
      Set OutlookApp = Nothing
      Application.ScreenUpdating = True
      End Sub

      Please let me know if it works for you, thank you.
  • To post as a guest, your comment is unpublished.
    Sherry · 4 years ago
    This code works good, however, does anyone know a way to automate a field as an alert for the email to go automatically based on a date column?
  • To post as a guest, your comment is unpublished.
    Adanma · 4 years ago
    Kindly help me out urgently. This the first time I am using the send current worksheet as PDF but the below code did not work at all and the dialogue to allow did not show up when I presses ctrl+G.

    I also want to know what to change to reference a cell that contained the email address instead of "to a specific email address.

    Sub SendWorkSheetToPDF()
    'Update 20131209
    Dim Wb As Workbook
    Dim FileName As String
    Dim OutlookApp As Object
    Dim OutlookMail As Object
    On Error Resume Next
    Set Wb = Application.ActiveWorkbook
    FileName = Wb.FullName
    xIndex = VBA.InStrRev(FileName, ".")
    If xIndex > 1 Then FileName = VBA.Left(FileName, xIndex - 1)
    FileName = FileName & "_" + ActiveSheet.Name & ".pdf"
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName
    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookMail = OutlookApp.CreateItem(0)
    With OutlookMail
    .To = "skyyang@extendoffice.com"
    .CC = ""
    .BCC = ""
    .Subject = "kte features"
    .Body = "Please check and read this document."
    .Attachments.Add FileName
    .Send
    End With
    Kill FileName
    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
    End Sub
  • To post as a guest, your comment is unpublished.
    Ramakumar · 5 years ago
    Sir

    I am able to send selected worksheet as attachment by including subject & Text.
    But the file name is showing as book1-02-apr-2016....

    Instead i want to give the file name in the code itself ( same name to continue every time i send)

    Kindly helpme
  • To post as a guest, your comment is unpublished.
    Archana · 5 years ago
    Can we allow the user to add the email ID with above mentioned code... Its works really good if we mention the To email id...
  • To post as a guest, your comment is unpublished.
    CHARLES · 5 years ago
    hi,
    im french , sorry for my english.
    How is it possible to put the value's cell of my sheet in .too/ .CC ...

    i think is it like :

    Sub SendWorkSheet()
    'Update 20131209
    Dim xFile As String
    Dim xFormat As Long
    Dim Wb As Workbook
    Dim Wb2 As Workbook
    Dim FilePath As String
    Dim FileName As String
    Dim OutlookApp As Object
    Dim OutlookMail As Object
    On Error Resume Next
    Application.ScreenUpdating = False
    Set Wb = Application.ActiveWorkbook
    ActiveSheet.Copy
    Set Wb2 = Application.ActiveWorkbook
    Select Case Wb.FileFormat
    Case xlOpenXMLWorkbook:
    xFile = ".xlsx"
    xFormat = xlOpenXMLWorkbook
    Case xlOpenXMLWorkbookMacroEnabled:
    If Wb2.HasVBProject Then
    xFile = ".xlsm"
    xFormat = xlOpenXMLWorkbookMacroEnabled
    Else
    xFile = ".xlsx"
    xFormat = xlOpenXMLWorkbook
    End If
    Case Excel8:
    xFile = ".xls"
    xFormat = Excel8
    Case xlExcel12:
    xFile = ".xlsb"
    xFormat = xlExcel12
    End Select
    FilePath = Environ$("temp") & "\"
    FileName = Wb.Name & Format(Now, "dd-mmm-yy h-mm-ss")
    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookMail = OutlookApp.CreateItem(0)
    Wb2.SaveAs FilePath & FileName & xFile, FileFormat:=xFormat
    With OutlookMail
    .To = "skyyang@extendoffice.com" & RANGE("AVIVA!b12")
    .CC = "" & RANGE("AVIVA!c12")
    .BCC = ""
    .Subject = "NOUVEAU DOSSIER"
    .body = "Please check and read this document."
    .Attachments.Add Wb2.FullName
    .DISPLAY
    .Send
    End With
    Wb2.Close
    Kill FilePath & FileName & xFile
    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
    Application.ScreenUpdating = True
    End Sub

    thank's for you help
  • To post as a guest, your comment is unpublished.
    Karan · 6 years ago
    Hi The macro works for me perfectly fine. I have never used macros before so, can anyone please put me in the right direction - I am trying to send this to more than one person but not sure how put extra email addresses in the "to" section of the macro.

    Thanks in advance
  • To post as a guest, your comment is unpublished.
    Jash · 6 years ago
    Hey I am using a automation process in my company I need to upgrade all my pc with the excel and outlook 2010 i have a code in windows xp with which i am mailing a sheet using outlook express the code is working fine in xp but now i need to upgrade it with windows 7 . I tried alot but i cant send the sheet so plz help
  • To post as a guest, your comment is unpublished.
    Jerry · 6 years ago
    Send single worksheet as an attachment from Excel with VBA code: Excellent VBA Code. Works GREAT !!! Thank you!!! :-)
    Instead of entering the To: & CC: e-mails manually, I want to pull the e-mail addresses from a separate worksheet called "E-Mail List". The (a1) has the "To" e-mail address and (b1) has the "CC" e-mail address. I know this is relatively simple to solve but I cannot figure out what I am doing wrong.

    Thank you everyone in advance.

    Wb2.SaveAs FilePath & FileName & xFile, FileFormat:=xFormat
    With OutlookMail
    .To = "skyyang@extendoffice.com"
    .CC = ""
    .BCC = ""
    .Subject = "kte features"
    .Body = "Please check and read this document."
    .Attachments.Add Wb2.FullName
    .Send
    End With
    Wb2.Close
    Kill FilePath & FileName & xFile
    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
    Application.ScreenUpdating = True
    End Sub
  • To post as a guest, your comment is unpublished.
    Shel · 6 years ago
    I'm trying to use this code to send a single spreadsheet using a personally created template *.ost file that resides on the c:\ drive. Can't seem to figure out how to adapt the code above for that. Any pointers?
  • To post as a guest, your comment is unpublished.
    Janet · 6 years ago
    Hi, I am using Office 2010 and Windows 7.
    Thanks!
    • To post as a guest, your comment is unpublished.
      admin_jay · 6 years ago
      [quote name="Janet"]Hi, I am using Office 2010 and Windows 7.
      Thanks![/quote]
      Hello, this VBA is OK with Office 2010 in Window 7. Please make sure you have open your Outlook before running this VBA.
  • To post as a guest, your comment is unpublished.
    Janet · 6 years ago
    I am using the code above to send a single sheet as an excel attachment, the problem I am having, is that it is sending the whole workbook, not just a single worksheet.
    I only changed the "To", "Subject" and "Body" for the email.
    I am not sure what went wrong.
    Help Please! :sad:
    • To post as a guest, your comment is unpublished.
      admin_jay · 6 years ago
      [quote name="Janet"]I am using the code above to send a single sheet as an excel attachment, the problem I am having, is that it is sending the whole workbook, not just a single worksheet.
      I only changed the "To", "Subject" and "Body" for the email.
      I am not sure what went wrong.
      Help Please! :sad:[/quote]
      Hello, please tell me the version information of your Office and computer system.
  • To post as a guest, your comment is unpublished.
    Janet · 6 years ago
    I am using the second example above to send a single sheet out of the workbook, but it is sending the whole workbook. I copied the above example and the only part I changed was the email address.
    I am not sure what is wrong.
  • To post as a guest, your comment is unpublished.
    SomeOneVBA · 6 years ago
    Hi,

    I'm using this code but I have any issue when sending.
    It's not a big problem but I don't like it :-)

    I first auto save the file to a certain location via VBA before sending the file by mail. The file already has name ending on .xlsx

    When emailing the file, the attachement reads .xlsx.xlsx so it adds .xslx to the file.

    Does anybody know if I can it to ignore saving before sending it as attachment ? I already have it saved before sending...

    Thanks,
  • To post as a guest, your comment is unpublished.
    Jim Bristow · 6 years ago
    I am attempting to Send Multiple Name Ranges within given workbooks as PDF's via Outlook. Automating open and closing numerous workbooks. I am not certain how to modify stated code below which works great sending a worksheet with All new versions on Laptop. I sent multiple reports each night off my desk top Windows 7 Excel and Outlook 10 Adobe Acrobat Pro 10 and attempting to reconfigure to do same on laptop with upgraded versions of windows 8.1 Office 15 and adobe acrobat Xl.

    Your Recommended Codes for Sending Worksheets

    Sub SendWorkSheetToPDF()
    'Update 20131209
    Dim Wb As Workbook
    Dim FileName As String
    Dim OutlookApp As Object
    Dim OutlookMail As Object
    On Error Resume Next
    Set Wb = Application.ActiveWorkbook
    FileName = Wb.FullName
    xIndex = VBA.InStrRev(FileName, ".")
    If xIndex > 1 Then FileName = VBA.Left(FileName, xIndex - 1)
    FileName = FileName & "_" + ActiveSheet.Name & ".pdf"
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName
    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookMail = OutlookApp.CreateItem(0)
    With OutlookMail
    .To = "jbristow1@gmail.com"
    .CC = ""
    .BCC = ""
    .Subject = "Outlook Code"
    .Body = "Please check and read this document."
    .Attachments.Add FileName
    .Send
    End With
    Kill FileName
    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
    End Sub
    • To post as a guest, your comment is unpublished.
      SomeOneVBA · 6 years ago
      Jim,

      You need to add ; behind the email address and add an other, see example below :

      .To = "jbristow1@gmail.com; someone@gmail.com; onemoreperson@gmail.com"
  • To post as a guest, your comment is unpublished.
    ogunyemi · 7 years ago
    I have attached send to mail recipient, but is not activated when i click to send the excel. What am i doning wrong?
  • To post as a guest, your comment is unpublished.
    Niti Trivedi · 7 years ago
    Hi I want to send only selected cells through a command button in excel to receipts through outlook.
  • To post as a guest, your comment is unpublished.
    Chanda · 7 years ago
    When I use the VBA code to send as a pdf, the email sends fine, however there is no attachment. What am I doing wrong?

    Thanks,
    Chanda
    • To post as a guest, your comment is unpublished.
      HosWorker · 6 years ago
      Did you get an anser for this? Im also having the same difficulty.
  • To post as a guest, your comment is unpublished.
    Russ Streff · 7 years ago
    How do you add multiple recipients in the second example using VBA code?