PC Review


Reply
Thread Tools Rate Thread

Checkboxes are duplicated over and over as emf in the Temp folder

 
 
=?Utf-8?B?RXNzZW5nYV9Ub20=?=
Guest
Posts: n/a
 
      20th Sep 2007
Hi,

I created an app with some checkboxes. The checkboxes are not in a form, but
are on the worksheet. The app is running 24/7. From time to time the app is
closed and opened again. In these events it took about 20 - 30 minutes to
close or open the app. After doing some investigation, problem turned out to
be the temp folder. I found about 20.000 emf files. These emf files appeared
to be multiple copies of the checkboxes used in my app.
Has anyone an idea what's happening here? How can I avoid this? If not
avoided, can I, from within XL, delete these emf files in the temp folder?

Thx in advance
Tom
 
Reply With Quote
 
 
 
 
Tim Zych
Guest
Posts: n/a
 
      20th Sep 2007
Good troubleshooting. You're right. Excel stores stuff in a temp
directory, and it is a good idea to clean this out periodically for the
reason you noticed. I don't think that Excel files are as easily corrupted
anymore, but older versions of Excel workbooks can actually become corrupted
because of the buildup of this folder, usually when they have controls on
the worksheet.

The directory is located at Start -> Run %temp%, or in VBA Excel will tell
you via Environ("temp")

Delete everything in there. If there are locking issues, reboot but don't
start Excel and delete everything.


"Essenga_Tom" <(E-Mail Removed)> wrote in message
news:CE74E7CE-1452-45BF-A01A-(E-Mail Removed)...
> Hi,
>
> I created an app with some checkboxes. The checkboxes are not in a form,
> but
> are on the worksheet. The app is running 24/7. From time to time the app
> is
> closed and opened again. In these events it took about 20 - 30 minutes to
> close or open the app. After doing some investigation, problem turned out
> to
> be the temp folder. I found about 20.000 emf files. These emf files
> appeared
> to be multiple copies of the checkboxes used in my app.
> Has anyone an idea what's happening here? How can I avoid this? If not
> avoided, can I, from within XL, delete these emf files in the temp folder?
>
> Thx in advance
> Tom





 
Reply With Quote
 
=?Utf-8?B?RXNzZW5nYV9Ub20=?=
Guest
Posts: n/a
 
      20th Sep 2007
Hi Tim,

Can I automate this from within VBA or XL with a macro? Let say every day
the temp folder will automatically be cleaned up?

"Tim Zych" wrote:

> Good troubleshooting. You're right. Excel stores stuff in a temp
> directory, and it is a good idea to clean this out periodically for the
> reason you noticed. I don't think that Excel files are as easily corrupted
> anymore, but older versions of Excel workbooks can actually become corrupted
> because of the buildup of this folder, usually when they have controls on
> the worksheet.
>
> The directory is located at Start -> Run %temp%, or in VBA Excel will tell
> you via Environ("temp")
>
> Delete everything in there. If there are locking issues, reboot but don't
> start Excel and delete everything.
>
>
> "Essenga_Tom" <(E-Mail Removed)> wrote in message
> news:CE74E7CE-1452-45BF-A01A-(E-Mail Removed)...
> > Hi,
> >
> > I created an app with some checkboxes. The checkboxes are not in a form,
> > but
> > are on the worksheet. The app is running 24/7. From time to time the app
> > is
> > closed and opened again. In these events it took about 20 - 30 minutes to
> > close or open the app. After doing some investigation, problem turned out
> > to
> > be the temp folder. I found about 20.000 emf files. These emf files
> > appeared
> > to be multiple copies of the checkboxes used in my app.
> > Has anyone an idea what's happening here? How can I avoid this? If not
> > avoided, can I, from within XL, delete these emf files in the temp folder?
> >
> > Thx in advance
> > Tom

>
>
>
>
>

 
Reply With Quote
 
Tim Zych
Guest
Posts: n/a
 
      20th Sep 2007
Here's some code that will delete files within a folder.

The filesystemobject has a folder.delete method, but if any file in a folder
is locked (common for the temp directory) that will fail. This loops through
the files and sets up a collection of all of the files to delete. Then it
loops through the collection of files to be deleted and kills them. Killed
files are not sent to the recycle bin and can't be recovered.

Function DeleteFiles()
Dim oFso As FileSystemObject
Set oFso = New FileSystemObject
Dim cFilesToDelete As Collection
Set cFilesToDelete = New Collection
Dim oFile As File
Dim sFilename As String
Dim sExt As String
sExt = ".emf" '<- Optional, to limit by file type
' sExt = "" '<- to return everything
For Each oFile In oFso.GetFolder(Environ("temp")).Files '<- modify
directory as needed
sFilename = oFile.Path
If sFilename Like "*" & sExt Then
cFilesToDelete.Add sFilename, sFilename
End If
Next
Dim i As Long
For i = 1 To cFilesToDelete.Count
Debug.Print "Deleting: " & cFilesToDelete(i)
On Error Resume Next ' In case a file is locked, continue
Kill cFilesToDelete(i)
On Error GoTo 0
Next
End Function

I modified this from some code I have that loops through every subdirectory
with a root directory and returns a list of all files found. But for what
you are doing it seems you can stay focused in the temp root.


"Essenga_Tom" <(E-Mail Removed)> wrote in message
news:3A3275A0-1C29-482A-A3A3-(E-Mail Removed)...
> Hi Tim,
>
> Can I automate this from within VBA or XL with a macro? Let say every day
> the temp folder will automatically be cleaned up?
>
> "Tim Zych" wrote:
>
>> Good troubleshooting. You're right. Excel stores stuff in a temp
>> directory, and it is a good idea to clean this out periodically for the
>> reason you noticed. I don't think that Excel files are as easily
>> corrupted
>> anymore, but older versions of Excel workbooks can actually become
>> corrupted
>> because of the buildup of this folder, usually when they have controls on
>> the worksheet.
>>
>> The directory is located at Start -> Run %temp%, or in VBA Excel will
>> tell
>> you via Environ("temp")
>>
>> Delete everything in there. If there are locking issues, reboot but don't
>> start Excel and delete everything.
>>
>>
>> "Essenga_Tom" <(E-Mail Removed)> wrote in message
>> news:CE74E7CE-1452-45BF-A01A-(E-Mail Removed)...
>> > Hi,
>> >
>> > I created an app with some checkboxes. The checkboxes are not in a
>> > form,
>> > but
>> > are on the worksheet. The app is running 24/7. From time to time the
>> > app
>> > is
>> > closed and opened again. In these events it took about 20 - 30 minutes
>> > to
>> > close or open the app. After doing some investigation, problem turned
>> > out
>> > to
>> > be the temp folder. I found about 20.000 emf files. These emf files
>> > appeared
>> > to be multiple copies of the checkboxes used in my app.
>> > Has anyone an idea what's happening here? How can I avoid this? If not
>> > avoided, can I, from within XL, delete these emf files in the temp
>> > folder?
>> >
>> > Thx in advance
>> > Tom

>>
>>
>>
>>
>>



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      20th Sep 2007
I use this .VBS script from Michael Harris:
http://groups.google.com/groups?thre...%40tkmsftngp02

I put the file in a nice location on my harddrive and add a shortcut on my
desktop.

Then I can run it whenever I want.

Essenga_Tom wrote:
>
> Hi Tim,
>
> Can I automate this from within VBA or XL with a macro? Let say every day
> the temp folder will automatically be cleaned up?
>
> "Tim Zych" wrote:
>
> > Good troubleshooting. You're right. Excel stores stuff in a temp
> > directory, and it is a good idea to clean this out periodically for the
> > reason you noticed. I don't think that Excel files are as easily corrupted
> > anymore, but older versions of Excel workbooks can actually become corrupted
> > because of the buildup of this folder, usually when they have controls on
> > the worksheet.
> >
> > The directory is located at Start -> Run %temp%, or in VBA Excel will tell
> > you via Environ("temp")
> >
> > Delete everything in there. If there are locking issues, reboot but don't
> > start Excel and delete everything.
> >
> >
> > "Essenga_Tom" <(E-Mail Removed)> wrote in message
> > news:CE74E7CE-1452-45BF-A01A-(E-Mail Removed)...
> > > Hi,
> > >
> > > I created an app with some checkboxes. The checkboxes are not in a form,
> > > but
> > > are on the worksheet. The app is running 24/7. From time to time the app
> > > is
> > > closed and opened again. In these events it took about 20 - 30 minutes to
> > > close or open the app. After doing some investigation, problem turned out
> > > to
> > > be the temp folder. I found about 20.000 emf files. These emf files
> > > appeared
> > > to be multiple copies of the checkboxes used in my app.
> > > Has anyone an idea what's happening here? How can I avoid this? If not
> > > avoided, can I, from within XL, delete these emf files in the temp folder?
> > >
> > > Thx in advance
> > > Tom

> >
> >
> >
> >
> >


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?RXNzZW5nYV9Ub20=?=
Guest
Posts: n/a
 
      21st Sep 2007
Tim, Dave,

Thx for the quick responses. For now, I will not be able to work on this
issue till beginning next month, due to other issues. In the meantime, I
assume my 'problem' solved with your answers provided.

Have a nice weekend!
Tom

"Tim Zych" wrote:

> Here's some code that will delete files within a folder.
>
> The filesystemobject has a folder.delete method, but if any file in a folder
> is locked (common for the temp directory) that will fail. This loops through
> the files and sets up a collection of all of the files to delete. Then it
> loops through the collection of files to be deleted and kills them. Killed
> files are not sent to the recycle bin and can't be recovered.
>
> Function DeleteFiles()
> Dim oFso As FileSystemObject
> Set oFso = New FileSystemObject
> Dim cFilesToDelete As Collection
> Set cFilesToDelete = New Collection
> Dim oFile As File
> Dim sFilename As String
> Dim sExt As String
> sExt = ".emf" '<- Optional, to limit by file type
> ' sExt = "" '<- to return everything
> For Each oFile In oFso.GetFolder(Environ("temp")).Files '<- modify
> directory as needed
> sFilename = oFile.Path
> If sFilename Like "*" & sExt Then
> cFilesToDelete.Add sFilename, sFilename
> End If
> Next
> Dim i As Long
> For i = 1 To cFilesToDelete.Count
> Debug.Print "Deleting: " & cFilesToDelete(i)
> On Error Resume Next ' In case a file is locked, continue
> Kill cFilesToDelete(i)
> On Error GoTo 0
> Next
> End Function
>
> I modified this from some code I have that loops through every subdirectory
> with a root directory and returns a list of all files found. But for what
> you are doing it seems you can stay focused in the temp root.
>
>
> "Essenga_Tom" <(E-Mail Removed)> wrote in message
> news:3A3275A0-1C29-482A-A3A3-(E-Mail Removed)...
> > Hi Tim,
> >
> > Can I automate this from within VBA or XL with a macro? Let say every day
> > the temp folder will automatically be cleaned up?
> >
> > "Tim Zych" wrote:
> >
> >> Good troubleshooting. You're right. Excel stores stuff in a temp
> >> directory, and it is a good idea to clean this out periodically for the
> >> reason you noticed. I don't think that Excel files are as easily
> >> corrupted
> >> anymore, but older versions of Excel workbooks can actually become
> >> corrupted
> >> because of the buildup of this folder, usually when they have controls on
> >> the worksheet.
> >>
> >> The directory is located at Start -> Run %temp%, or in VBA Excel will
> >> tell
> >> you via Environ("temp")
> >>
> >> Delete everything in there. If there are locking issues, reboot but don't
> >> start Excel and delete everything.
> >>
> >>
> >> "Essenga_Tom" <(E-Mail Removed)> wrote in message
> >> news:CE74E7CE-1452-45BF-A01A-(E-Mail Removed)...
> >> > Hi,
> >> >
> >> > I created an app with some checkboxes. The checkboxes are not in a
> >> > form,
> >> > but
> >> > are on the worksheet. The app is running 24/7. From time to time the
> >> > app
> >> > is
> >> > closed and opened again. In these events it took about 20 - 30 minutes
> >> > to
> >> > close or open the app. After doing some investigation, problem turned
> >> > out
> >> > to
> >> > be the temp folder. I found about 20.000 emf files. These emf files
> >> > appeared
> >> > to be multiple copies of the checkboxes used in my app.
> >> > Has anyone an idea what's happening here? How can I avoid this? If not
> >> > avoided, can I, from within XL, delete these emf files in the temp
> >> > folder?
> >> >
> >> > Thx in advance
> >> > Tom
> >>
> >>
> >>
> >>
> >>

>
>
>

 
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
Windows Vista strange settings on temp folder AppData\Local\Temp\1 Nick Windows Vista Security 2 13th May 2009 06:14 PM
Using the windows\temp folder for programs? (or use what temp directory in its place)? Bill in Co. Windows XP General 10 25th Jan 2008 04:30 AM
Deleting Temp Folder at: Documents and Setting\User Name\Temp eli Windows XP Basics 14 16th Sep 2006 04:19 AM
Deleting Temp Folder at: Documents and Setting\User Name\Temp eli Windows XP General 14 16th Sep 2006 04:19 AM
Shift 'Temp' folder, 'Temp Internet Folder' to another partition Shrikant Windows XP Configuration 2 14th Feb 2005 01:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:11 PM.