Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp | Excel Discussion (Misc queries) | |||
Original Excel File gets deleted and temp file gets created. | Excel Programming | |||
delete all the contents (sub folders and files) in the temp folder | Excel Discussion (Misc queries) | |||
What Are And Can I Delete .EMF Files in WINNT/Temp Directory ? | Excel Programming | |||
Temp File | Excel Programming |