+ Reply to Thread
Results 1 to 3 of 3

VBA to send email swithes file status

  1. #1
    Registered User
    Join Date
    09-20-2013
    Location
    Hartland, WI
    MS-Off Ver
    Excel 2013 Professional Plus
    Posts
    73

    VBA to send email swithes file status

    Below is a VBA that sends an email with a range from Excel in the body of the email, and the entire book as an attachment from a temporary file. It works great, except that I need the entire file to close, and it will not because a message pops up that says "Do you want to save file before switching file status". This will not let Excel close. I need to bypass that pop up message. Display Alerts = False did not work. In the bottom of the code below, there is a spot that tries to kill the temporary file, but it does not work until "No" in the pop up message is pressed. Again, I need to bypass that pop up message. Any ideas?

    Please Login or Register  to view this content.
    Last edited by gillyr7; 02-04-2014 at 04:37 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: VBA to send email swithes file status

    You might try setting the Saved property of the workbook to TRUE just before the prompt occurs. This might fool the application into thinking that the file is already saved and therefore not to prompt.

  3. #3
    Registered User
    Join Date
    09-20-2013
    Location
    Hartland, WI
    MS-Off Ver
    Excel 2013 Professional Plus
    Posts
    73

    Re: VBA to send email swithes file status

    I looked over the code, and I found a displayalerts = true, which I did not find before. That is why when I tried to add a displayalerts = false, it did not do anything. Once I changed the first one, it worked. I will try your solution if something else comes up. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Send excel file attached in email
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2013, 03:55 AM
  2. Convert tab to PDF file; then send file to email
    By noidea_4 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2013, 02:53 PM
  3. VBA Email won't send active file
    By jtd84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2012, 01:09 AM
  4. send email via excel for action items with overdue status
    By xiaotianshi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2007, 11:21 AM
  5. [SOLVED] Send file in an email
    By SAS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2006, 12:35 PM

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