Results 1 to 10 of 10

Thread: Email worksheet as TXT or as CSV

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    What is Groupwise? They really need to use Outlook.

    This code will export the sheet, save it, then delete it. I just made the path c:\ but that can be changed to any valid path.

     
    Option Explicit
     
    Sub Export()
    Application.DisplayAlerts = False
    Application.ScreenUpdating = False
    Sheets("TimeSheet").Copy
    ActiveWorkbook.SaveAs Filename:="C:\Time Sheet.txt", FileFormat:=xlText
    ActiveWorkbook.Close
    'Code here for emailing the file.
    Kill "C:\Time Sheet.txt"
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    End Sub
    Last edited by Aussiebear; 03-29-2023 at 03:44 PM. Reason: Adjusted the code tags

Posting Permissions

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