File opens very slowly in Excel 2000

Symptoms

When you open or close a workbook in Microsoft Excel, the operation may take longer than expected.

Cause

This behavior can occur if one or more .emf files in the following folders are corrupted:
C:\Windows\Temp
(Microsoft Windows 98 or Microsoft Windows Millennium Edition [Me])
Documents and Settings\Username\Local Settings\Temp
(Microsoft Windows 2000)

Resolution

To resolve this issue, follow these steps:
  1. Start Windows Explorer.
  2. Locate C:\Windows\Temp, or to Documents and Settings\Username\Local Settings\Temp (depending on your operating system).
  3. Right-click the .emf file, and then click Delete.

    You receive a message similar to the following:
    Are you sure you want to send file to the Recycle Bin?
  4. Click Yes on the message.
  5. Repeat steps 3 and 4 until all of the .emf files have been deleted.

Workaround

To prevent this behavior from occurring, use the following code to create a Microsoft Visual Basic macro.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:

Microsoft Certified Partners - https://partner.microsoft.com/global/30000104

Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
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

References

For additional information about how to troubleshoot slow performance when you open Excel workbooks, click the following article number to view the article in the Microsoft Knowledge Base:

292298 XL2000: Workbooks with Multiple ActiveX Controls May Open Slowly

Propriedades

ID do Artigo: 299372 - Última Revisão: 13 de jul de 2009 - Revisão: 1

Comentários