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 "micael.jon1.ctr@navy.mil", InputBox("Please type subject")
ActiveWorkbook.Close False
Kill Filename
End Sub
Last edited by Ambassador777; 06-01-2011 at 03:07 PM.
Hi Ambassador777, before anyone is able to help you, you need to enclose your code with code tags. To do so, click here and read Rule 3 to find out how.
Please leave a message after the beep!
Hi Ambassador777
In anticipation of you using code tags ....
Try adding the file extension to Filename before killing it.
barry
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks