[dba-Tech] Excel bloat question

MartyConnelly martyconnelly at shaw.ca
Thu May 17 18:00:04 CDT 2007


If you turn on Track Changes, the file may bloat

I believe Excel stores VBA code as P-Code or maybe just some meta-data
about the P-Code.  Much the same way access does.  Problem is this is a
one way growing operation.  Every change made requires the metadata to
be rebuilt and as such it will generally take up more space.

Now, even though you might fully cut 1/3 of the modules and code out of
the project, when you save it is not going to get any smaller, it's just
going to have much more 'whitespace' in the meta data.

To reduce file size , you could get "VBA Code Cleaner" add-in
from Baarns Consulting (www.baarns.com) (But one thing you need to note is
that, that add-in was not designed for Excel 2000. In case it doesn't run
in Excel 2000, you may need to modify the code a bit.)

http://archive.baarns.com/software/

Or see this for other methods

http://www.ozgrid.com/Excel/ExcelProblems.htm


http://www.bmsltd.ie/MVP/Default.htm
Look for Rob Bovey code cleaner

http://exceltips.vitalnews.com/Pages/T1248_Sudden_Increases_in_Workbook_File_Size.html

I am guessing that code methods above use something like this to
reduce file size, similar to Access SaveAsText method moving
code to a new mdb.


Function SaveVBAasText()
Dim iCount As Integer
Dim tFileName As String
Dim tPath As String
Dim SuffixTxt As String

    tPath = ThisWorkbook.Path & "\ObjectsAsText" & Format(Now(), 
"yyyymmddhhnnss") & "\"
    MkDir tPath
    SuffixTxt = ".txt"
      Debug.Print tPath
    'Now save
    For iCount = 1 To Application.VBE.ActiveVBProject.VBComponents.Count
        tFileName = tPath & 
Application.VBE.ActiveVBProject.VBComponents.Item(iCount).Name & SuffixTxt
        Application.VBE.ActiveVBProject.VBComponents.Item(iCount).Export 
tFileName
    Next
Debug.Print tFileName
End Function


Susan Harkins wrote:

>Jim, this was what I planned to write about. 
>
>Jon, have you ever tried this? Anybody? I'm wondering what the difference is
>between just deleting rows and columns and creating a new sheet or workbook.
>
>
>Susan H. 
>
>
>I found this on the net:
>
>Jim Hale
>
>Honey Can I Shrink the Spreadsheet ? 
>
>Rodney POWELL <mailto:rodney at beyondtechnology.com>
>Microsoft MVP - Excel
>
>__
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada




More information about the dba-Tech mailing list