Results 1 to 3 of 3

Excel Outlook Attachment Macro is attaching the Personal.XLSB and not the current file

Threaded View

  1. #1
    Registered User
    Join Date
    08-13-2009
    Location
    Glasgow
    MS-Off Ver
    Excel 2016,2016,365
    Posts
    92

    Excel Outlook Attachment Macro is attaching the Personal.XLSB and not the current file

    Hello,

    Please see code below. Can you help please with the following.
    1. Can I add a .From in the send macro as I want it to come from HRSS@companyname.com and not from my own personal company email address.
    2. When the email sends it attaching the Personal.XLSB file and not the spreadsheet that is open.

    I have attached the macros before I run the send one.
    Sub PJAbsence()
    '
    ' PJAbsence Macro
    '
    
    '
        Columns("E:L").Select
        ActiveWindow.SmallScroll ToRight:=8
        Columns("E:Q").Select
        ActiveWindow.SmallScroll ToRight:=1
        Selection.Delete Shift:=xlToLeft
        Range("D24").Select
        
        DirPath = "H:\HR\Reward & Shared Services\Shared Services Only\5 ~ Management Information\4 ~ Weekly Reports\Weekly Absence open ended\Open ended absence"
    DateStr = Format(Date, " yyyymmdd")
    
    ActiveWorkbook.SaveAs Filename:=DirPath & DateStr
    
    
    
    End Sub
    
    Sub send_Mail()
    
    Dim outlookOBJ As Object
    Dim mItem As Object
    Set outlookOBJ = CreateObject("Outlook.Application")
    Set mItem = outlookOBJ.createitem(olMailItem)
    With mItem
        .to = "EMAIL ADDRESS"
        .Subject = " Absence Report"
        .body = "Please find attached Absence Report" & vbCrLf & " Best Regards" & vbCrLf & "HRSS"
        .attachments.Add ThisWorkbook.Path & "\" & ThisWorkbook.Name
        .Send
    
    End With
    
        
    End Sub

    Thanks

    Ross
    Last edited by rosscortb; 07-05-2017 at 11:10 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 03-14-2016, 12:41 PM
  2. [SOLVED] Personal.XLSB macro pasting into Personal.XLSB
    By davepoth in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-11-2015, 07:40 PM
  3. [SOLVED] Outlook Attachment - PDF file not attaching.
    By Maroota in forum Outlook Formatting & Functions
    Replies: 16
    Last Post: 05-01-2015, 06:57 AM
  4. Replies: 7
    Last Post: 03-30-2015, 05:51 PM
  5. Replies: 0
    Last Post: 01-15-2015, 05:53 AM
  6. [SOLVED] Run PERSONAL.XLSB macro when any Excel file is opened
    By Aaron092 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2014, 04:35 AM
  7. Close Excel event to use with personal.xlsb file
    By richard.wilson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2014, 05:28 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1