Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Delete temp file

I have the next code:

' Save chart as GIF
fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
TempChart.Export Filename:=fname, filterName:="GIF"
A.ChartObjects(1).Delete
Application.ScreenUpdating = True


I have a userform in which a have a button which displays a chart, and the
chart is saved temporaly in the same folder as the excel file, but after I
close the file the temp.gif is still there in the folder, so what I want is
to erase the file after is Exported or the excel file is closed. Can this be
done ?

Thanks !
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Delete temp file

Look at Kill in VBA's help.

But I'm not sure when you'd want to actually delete the file.

Carlos wrote:

I have the next code:

' Save chart as GIF
fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
TempChart.Export Filename:=fname, filterName:="GIF"
A.ChartObjects(1).Delete
Application.ScreenUpdating = True


I have a userform in which a have a button which displays a chart, and the
chart is saved temporaly in the same folder as the excel file, but after I
close the file the temp.gif is still there in the folder, so what I want is
to erase the file after is Exported or the excel file is closed. Can this be
done ?

Thanks !


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Delete temp file

Thanks Dave!

I did use: Kill (ThisWorkbook.Path & Application.PathSeparator & "temp.gif")

Thank you very much!!

"Dave Peterson" wrote:

Look at Kill in VBA's help.

But I'm not sure when you'd want to actually delete the file.

Carlos wrote:

I have the next code:

' Save chart as GIF
fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
TempChart.Export Filename:=fname, filterName:="GIF"
A.ChartObjects(1).Delete
Application.ScreenUpdating = True


I have a userform in which a have a button which displays a chart, and the
chart is saved temporaly in the same folder as the excel file, but after I
close the file the temp.gif is still there in the folder, so what I want is
to erase the file after is Exported or the excel file is closed. Can this be
done ?

Thanks !


--

Dave Peterson

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
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp Yuvraj Excel Discussion (Misc queries) 3 May 3rd 09 11:59 AM
Original Excel File gets deleted and temp file gets created. Sandy[_7_] Excel Programming 11 December 12th 06 01:31 AM
delete all the contents (sub folders and files) in the temp folder Joseph Excel Discussion (Misc queries) 0 June 6th 05 08:01 AM
What Are And Can I Delete .EMF Files in WINNT/Temp Directory ? Donna[_7_] Excel Programming 2 February 15th 05 12:24 PM
Temp File Jullie Excel Programming 0 December 15th 03 05:33 PM


All times are GMT +1. The time now is 08:25 AM.

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

About Us

"It's about Microsoft Excel"