File opens very slowly in Excel 2000 (299372)



The information in this article applies to:

  • Microsoft Excel 2000

This article was previously published under Q299372

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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
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


Modification Type:MinorLast Reviewed:1/7/2006
Keywords:kbPerformance kbopenfile KbVBA kbProgramming kbprb KB299372