Results 1 to 3 of 3

Copy, Sendemail, Killfile

Threaded View

  1. #1
    Registered User
    Join Date
    05-16-2011
    Location
    Virginia Beach, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    22

    Copy, Sendemail, Killfile

    I have a main workbook that contains a funding request blank worksheet - like a template -and the remaining worksheets in the book are filled in funding requests.

    When I fill out a new request I want to email just the new sheet and save a copy to the end of the main workbook. I no longer need the temporary copy that I email because I'm going to have a copy at the end of the main workbook. I drafted up this code which works for the most part as far as sending a copy - it does work but it also generates a Run-time error '53': File not found - I presume from killing the temporary file.

    My question is, "How do I eliminate this error box from displaying?"

    Thanks in advance!



    Sub SendOneSheet()
    Dim Filename As String
    Filename = InputBox("Please name the file ")
    ActiveWorkbook.Worksheets.Copy
    ActiveWorkbook.SaveAs Filename
    ActiveWorkbook.SendMail "[email protected]", InputBox("Please type subject")
    ActiveWorkbook.Close False
    Kill Filename

    End Sub
    Last edited by Ambassador777; 06-01-2011 at 03:07 PM.

Thread Information

Users Browsing this Thread

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

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