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

Hi,
Anyone know how I can call a macro to delete my temp internet file
directory after I close the workbook

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Delete Temporary internet files

AFAIK temp internet files are best deleted from within
DOS, manually or via a Batch file. Probably requires IE
not loaded and possibly "not logged in".

Goto Google / Groups and search:
"delete temp* internet files batch-file"

Don't see why a Batch file cannot be called from VBA. If
lucky, some brave person might put it all together, test
and advise us!

Regards,
Peter

-----Original Message-----
Hi,
Anyone know how I can call a macro to delete my temp

internet files
directory after I close the workbook?


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Temporary internet files

Thanks for the reply.. but I actually need the actual code for doin
this ... I found one on the net he

http://www.mvps.org/emorcillo/vb6/inet/index.shtml

But I can't manage to get it to work

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Delete Temporary internet files

That links to a vb6 project which in turn requires a
reference to the author's "olelib.tlb". Need to download
that and install per his instructions. It looks very
clever.

Following seems to work for me on my standalone W98.
Try "at your own risk" having searched and read as I
previously suggested.

In a text editor save with a "bat" extension,
say "TestDel.bat" in c:\

smartdrv
deltree /Y c:\windows\history
deltree /Y c:\windows\tempor~1
@cls
@exit

Sub DelTempIE()
retVal = Shell("C:\TestDel.bat")
End Sub

If you want it to run when your wb exits put it in the
workbook's BeforeClose event. I assume this should be
done with IE not running.

Regards,
Peter

-----Original Message-----
Thanks for the reply.. but I actually need the actual

code for doing
this ... I found one on the net he

http://www.mvps.org/emorcillo/vb6/inet/index.shtml

But I can't manage to get it to work!


---
Message posted from http://www.ExcelForum.com/

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Temporary internet files

hmm.. I've thought about it though.. let us say you wanted to downloa
it for viewing from the web. since it is downloaded into the tem
folder when it is opened, will running the macro before close remov
it?

Also it appears that your bat file removes the directory tree of th
temporary internet files, does that affect the functioning of IE a
all

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Delete Temporary internet files


hmm.. I've thought about it though.. let us say you
wanted to download it for viewing from the web. since it
is downloaded into the temp folder when it is opened,
will running the macro before close remove it?


I would strongly urge you not to even think about trying
to clean up temp internet files on other peoples systems,
with this DOS method or any other. Some would classify
that as a virus, even if only trying to selectively delete
your own your file that someone has downloaded.

Also it appears that your bat file removes the directory
tree of thetemporary internet files, does that affect the
functioning of IE at all?


Reading what others far more knowledge than I say on the
subject (the search I originally suggested) the IE folders
are recreated if not found. That indeed seems to be the
case, but I've only tested with IE NOT running.
Personally I would not want to run the bat file
automatically when closing a wb, at the very least get
Msgbox confirmation. But you did ask!

FWIW, several suggest putting the deltree commands in
AutoExec.Bat to do a clean up on start-up.
Other suggested delete commands:

deltree /Y c:\windows\cookies
deltree /Y c:\windows\temp\

Note the extra "\" with the system temp folder only
deletes contents, not the folder itself.

Regards,
Peter

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Temporary internet files

Thanks peter... I know it's not right to do this... but the initia
idea is to stop someone from actually going into the temp interne
folder to prevent them from taking my file and mess around...

Thus I thought that if I could delete the file from the cache afte
the user is done reading it , it could suit my purposes.

Perhaps you have a better idea

--
Message posted from http://www.ExcelForum.com

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Delete Temporary internet files

What's to stop anyone right-clicking link and SaveAs.
Search this ng for ways of protecting your wb & code as
much as possible, which isn't much. Passwords, code in
BeforeClose and/or BeforeSave to delete stuff, read only.
Might keep out the uninitiated but even they could copy
sheets.

Regards,
Peter

...I know it's not right to do this...

Phew!


-----Original Message-----
Thanks peter... I know it's not right to do this... but

the initial
idea is to stop someone from actually going into the temp

internet
folder to prevent them from taking my file and mess

around...

Thus I thought that if I could delete the file from the

cache after
the user is done reading it , it could suit my purposes.

Perhaps you have a better idea?


---
Message posted from http://www.ExcelForum.com/

.

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
How do I open temporary internet files mdoyer Excel Discussion (Misc queries) 3 October 12th 09 07:41 AM
how can i delete excel temporary files en mass? cs103 Excel Discussion (Misc queries) 2 February 16th 09 05:37 PM
Network Files creating temporary files Dave Weastec Excel Discussion (Misc queries) 0 October 3rd 08 02:26 PM
Why does Excel saves all my files as temporary files? Arija Excel Discussion (Misc queries) 2 December 7th 04 11:38 PM
Listing Temporary Internet Files Alan Phang Excel Programming 3 February 11th 04 04:09 AM


All times are GMT +1. The time now is 05:46 AM.

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"