Modify code to attach specific sheet as .xlsx

  • Hi,


    I am using this code to send and attachment through outlook as a PDF. Now I need to send that same attachment as a .xlsx. Also I would like it to be a specific sheet that is attached, not active sheet.


    How can this code be modified?


  • Re: Modify code to attach specific sheet as .xlsx


    hello,
    you can add something like

    Code
    1. Dim wb As Workbook
    2. ActiveSheet.Copy
    3. Set wb = ActiveWorkbook
    4. PdfFile = ThisWorkbook.Path & "\" & ActiveSheet.Name & " " & Range("I10").Value & " " & Range("I11").Value
    5. With wb
    6. .SaveAs PdfFile
    7. .Close False
    8. End With