Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Saving then Delete Workbook
Is there a way to save a temp file so that I can send an e-mail then have it
delete when the e-mail is sent? I'm using a macro to send the e-mail. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Saving then Delete Workbook
hi,
Try something like this..... Sub SaveSendDelete() Dim StrPath As String Dim StrFileName As String Dim StrToDelete As String ChDir "C:\" ActiveWorkbook.SaveAs Filename:="C:\Book1.xls", FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False ActiveWorkBook.Close ' your email macro StrPath = "c:\" ' the folder path StrFileName = InputBox("Enter File Name") StrToDelete = StrPath & StrFileName & ".xls" On Error GoTo Err Kill StrToDelete MsgBox ("File " & StrFileName & ".xls" & " deleted!") Exit Sub Err: MsgBox "Whao!! ERROR!!! File NOT deleted!!" End Sub since i have not seen your email macro....edit above to fit your machine. worked on my machine. except for the email part. using xp regards FSt1 "Vick" wrote: Is there a way to save a temp file so that I can send an e-mail then have it delete when the e-mail is sent? I'm using a macro to send the e-mail. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving Workbook | Excel Discussion (Misc queries) | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) | |||
saving workbook | Excel Worksheet Functions | |||
Saving workbook from VB | Excel Discussion (Misc queries) | |||
Saving to a network share without delete permssions | Excel Discussion (Misc queries) |