|
|
|
|
|
|
Excel
|
Speed Up Excel Startup
|
|
Ease of Use
|
Intermediate
|
Version tested with
|
Excel 2000
|
Submitted by:
|
tommy bak
|
Description:
|
This VB script deletes Excel's toolbar file, *.xlb.
|
Discussion:
|
On some computers, Excel's toolbar file tends to grow very big. Eventually, this can slow down Excel's startup and make the opening of big files impossible. I have just experienced this problem on a coworker's computer. She had difficulty opening her regular files and Excel seemed to crawl. We discovered that her toolbar file had bloatet to 12.5MB (12,500KB) which Excel had to load on startup. Normal size for an XLB file is somewhere between 14KB and 25KB. After deleting the XLB file, the problems disappeared. WARNING: The file "regenerates" itself, but all of your personal menu settings are gone and must be re-customized.
|
Code:
|
instructions for use
|
Dim usrname
Dim path2000XP
Dim path98NTME
Dim path98NoProfile
Dim fso
Dim objWSH
Dim answer
answer = msgbox ("This script deletes Excel's toolbar file." & vbcrlf & _
"Please ensure that Excel is closed, so that the code will run properly." & vbcrlf & _
"Press OK to continue, Cancel to stop", vbokcancel)
If answer <> vbOK Then wscript.quit(1)
Set objWSH = CreateObject("WScript.Network")
usrname=objWSH.UserName
path98NoProfile = "C:\Windows\Application Data\Microsoft\Excel\excel*.xlb"
path98NTME = "C:\Windows\Profiles\" & usrname & "\Application Data\Microsoft\Excel\excel*.xlb"
path2000XP = "C:\Documents and Settings\" & usrname & "\Application Data\Microsoft\Excel\excel*.xlb"
Set fso = CreateObject("scripting.filesystemobject")
On Error Resume Next
fso.deletefile path98NoProfile
fso.deletefile path98NTME
fso.deletefile path2000XP
Set fso = Nothing
Set objWSH = Nothing
msgbox "xlb-file is deleted"
|
How to use:
|
- This script is NOT VBA, but a vbscript.
- Copy the code into Notepad.
- Then save it as e.g. RemoveXLB.vbs to your desktop. (make sure that the extension is correct)
- Close the file.
|
Test the code:
|
- Make sure that Excel is closed or the script will have no effect.
- For safekeeping, please make copies of any *.XLB files before testing.
- Now click / doubleclick the file on your desktop to run the script. NOTE: This script will have no effect if VB scripting has been disabled on your computer. NOTE: Your virus scanner may warn you of a potentially dangerous script; you can choose to let it continue to run until finished.
|
Sample File:
|
Removexlb.zip 0.66KB
|
Approved by mdmackillop
|
This entry has been viewed 700 times.
|
|