G
giorgio
This macro was on the MicroSoft website as a work around for the .emf
storage problem
http://support.microsoft.com/default.aspx?scid=kb;en-us;299372
What exactly does this macro do and how should I use it? I want to
remove all the .emf files from a particular Excel File. B/c the
workbook creates hundreds or thousands of temp .emf files everytime it
opens and it takes forever to open..
Thank you very much for any help!
george
Private Sub Workbook_Open()
Call DeleteEMFs
End Sub
Private Sub DeleteEMFs()
Dim fso As Variant
Set fso = CreateObject("Scripting.FileSystemObject")
Dim fs As FileSearch
Dim i As Long
Set fs = Application.FileSearch
With fs
.LookIn = fso.GetSpecialFolder(2)
.Filename = "*.emf"
If .Execute(SortBy:=msoSortByFileName,
SortOrder:=msoSortOrderAscending) > 0 Then
On Error Resume Next
For i = 1 To .FoundFiles.Count
Kill .FoundFiles(i)
Next i
On Error GoTo 0
End If
End With
Set fso = Nothing
Set fs = Nothing
End Sub
storage problem
http://support.microsoft.com/default.aspx?scid=kb;en-us;299372
What exactly does this macro do and how should I use it? I want to
remove all the .emf files from a particular Excel File. B/c the
workbook creates hundreds or thousands of temp .emf files everytime it
opens and it takes forever to open..
Thank you very much for any help!
george
Private Sub Workbook_Open()
Call DeleteEMFs
End Sub
Private Sub DeleteEMFs()
Dim fso As Variant
Set fso = CreateObject("Scripting.FileSystemObject")
Dim fs As FileSearch
Dim i As Long
Set fs = Application.FileSearch
With fs
.LookIn = fso.GetSpecialFolder(2)
.Filename = "*.emf"
If .Execute(SortBy:=msoSortByFileName,
SortOrder:=msoSortOrderAscending) > 0 Then
On Error Resume Next
For i = 1 To .FoundFiles.Count
Kill .FoundFiles(i)
Next i
On Error GoTo 0
End If
End With
Set fso = Nothing
Set fs = Nothing
End Sub