Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checkboxes are duplicated over and over as emf in the Temp folder

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Checkboxes are duplicated over and over as emf in the Temp folder

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" wrote in message
...
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





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Checkboxes are duplicated over and over as emf in the Temp fol

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" wrote in message
...
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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Checkboxes are duplicated over and over as emf in the Temp fol

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" wrote in message
...
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" wrote in message
...
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








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Checkboxes are duplicated over and over as emf in the Temp fol

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" wrote in message
...
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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Checkboxes are duplicated over and over as emf in the Temp fol

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" wrote in message
...
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" wrote in message
...
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
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
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp Yuvraj Excel Discussion (Misc queries) 3 May 3rd 09 11:59 AM
Why does Office always save my file in a temp folder? Help Save Work Easier Excel Discussion (Misc queries) 1 September 30th 07 10:39 PM
Finding temp folder. Environment variable? Don Wiss Excel Programming 6 August 15th 06 06:07 PM
delete all the contents (sub folders and files) in the temp folder Joseph Excel Discussion (Misc queries) 0 June 6th 05 08:01 AM
Create a folder.... (Post Duplicated?) Bob Phillips[_5_] Excel Programming 0 September 17th 03 10:57 PM


All times are GMT +1. The time now is 06:31 PM.

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"