PC Review


Reply
Thread Tools Rate Thread

Delete temp file

 
 
Carlos
Guest
Posts: n/a
 
      5th Mar 2008
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 !
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      5th Mar 2008
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 With Quote
 
Carlos
Guest
Posts: n/a
 
      5th Mar 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Temp file won't delete Bubey Windows XP Help 4 1st Mar 2007 04:47 PM
Cant Delete Old Temp File =?Utf-8?B?THVpczkxMQ==?= Windows XP General 3 12th Jul 2006 02:14 PM
Can I delete all tmp file in the TEMP folder? Chris Microsoft Windows 2000 4 23rd May 2004 10:32 AM
cannot delete temp file steener Windows XP Internet Explorer 7 1st May 2004 01:15 AM
Temp file won't delete Michael Abrams Windows XP New Users 6 2nd Sep 2003 11:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:09 PM.