Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Workbook Jeff Excel Discussion (Misc queries) 1 March 30th 07 07:57 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
saving workbook Leemac Excel Worksheet Functions 2 February 12th 06 12:28 PM
Saving workbook from VB Old Car Excel Discussion (Misc queries) 4 April 30th 05 07:24 AM
Saving to a network share without delete permssions SteveHoot Excel Discussion (Misc queries) 1 January 5th 05 09:50 PM


All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"