LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro buttons causing XL fatal errors?

There are API functions to get that temporary folder, too.

Here's a link with a couple of alternatives to get that temporary folder:
http://groups.google.co.uk/group/mic...6fb38808d3f14e

or

http://snipurl.com/h2jc

Then you could loop through the files trying to delete them???



davegb wrote:

Dave Peterson wrote:
Oops. Sorry.

http://groups.google.com/groups?thre...%40tkmsftngp02
is a link to Michael Harris's script to clean up the temp folder.

And depending on how your IT folks disabled scripting, you might not be able to
run this:

Option Explicit
Sub testme()

' Dim FSO As Scripting.FileSystemObject
' Dim myFile As Scripting.File
' Dim TempFolder As Scripting.Folder
' Dim myFolder As Scripting.Folder
' Set FSO = New Scripting.FileSystemObject

Dim FSO As Object
Dim myFile As Object
Dim TempFolder As Object
Dim myFolder As Object
Set FSO = CreateObject("Scripting.FileSystemObject")

Set TempFolder = FSO.GetSpecialFolder(2) 'TemporaryFolder = 2

On Error Resume Next
For Each myFile In TempFolder.Files
FSO.DeleteFile myFile.Path
Next myFile

For Each myFolder In TempFolder.SubFolders
FSO.DeleteFolder myFolder.Path
Next myFolder
On Error GoTo 0

End Sub

The commented lines would be used if you did Tools|references and included a
reference to Microsoft Scripting Runtime. (and comment out the next section).



davegb wrote:

Dave Peterson wrote:
Copy the code
paste into notepad
save as: deletetempfiles.vbs

double click on that when you want to clean the temp files.

(I actually put the .vbs file in a folder and put a shortcut to that .vbs file
on the desktop.)

But Dana DeLouis converted it so that it can be used in xl.

http://groups-beta.google.com/group/...932c72cef21fbe

or

http://tinyurl.com/djnys

davegb wrote:

Dave Peterson wrote:
That temp file can get cluttered pretty fast--maybe cleaning it every day???

I have a VBS script in a folder and a shortcut to it on my desktop.

Since there are lots of programs that fail to clean up after themselves, I like
to run it on demand--either right when I turn on the pc or right before I shut
it off.

It was written by Michael Harris:
http://groups.google.com/groups?thre...%40tkmsftngp02

davegb wrote:
<<snipped
I'm not too sure this fix is working. XL locked up on me yesterday
afternoon, not long after I cleaned out my Temp file. Will keep working
on it....

--

Dave Peterson

Thanks for the additional information. Since I don't know anything
about VB scripting, I wouldn't even know where to start to use that
code. Was wondering if there's a way to do that from Execl VBA so that
when XL is opened, it cleans out the Temp file?

--

Dave Peterson

Dave,
Finally got back to this. I can't run the VB script, my network system
won't allow it. And the link you posted was to a program to reset the
system clock. Do you know where the XL VBA program is to clean out the
Temp file?
Thanks.


--


Thanks again, Dave. But it won't run either. I doubt that any vbscript
file will work. I'm going to contact IT and see if I can get a "special
dispensation".
Dave Peterson


--

Dave Peterson
 
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
Decimal rounding causing addition errors TKGerdie Excel Discussion (Misc queries) 2 April 16th 09 03:51 PM
conditional forming causing linking errors Dave Breitenbach Excel Worksheet Functions 0 April 1st 05 08:19 PM
sumproduct causing memory errors? dave Excel Worksheet Functions 1 March 3rd 05 09:31 AM
large sumproducts causing memory errors dave Excel Discussion (Misc queries) 0 March 2nd 05 09:06 PM
Q: References: upgraded office, library changed causing errors Keith R[_3_] Excel Programming 1 February 6th 04 08:13 PM


All times are GMT +1. The time now is 01:06 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"