View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Carlos Carlos is offline
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 !