LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default counting how many lines of code in each workbook - memory issues

I am trying but...

Excel doesn't seem to be up to the task.

The aim was to list all workbooks with macros....to plan an upgrade/
s...to office 2007.

If there are a few addins that were converted back to .xls files, then
you get heaps of ghosts in your vb project and it fails.

Will post the rest of the code if anyone thinks they can do it..

Essentially, each time trying to count the lines of code to make sure
that there are some macros....
That is what is creating the memory leaks and ghost projects...

This goes crazy in both excel 2003 and 2007.....

Public Function CountLines(wb As Workbook) As Long Dim i As Integer
Dim lngLines As Long

' Debug.Print wb.VBProject.VBComponents.Count
lngLines = 0
For i = 1 To wb.VBProject.VBComponents.Count
' Debug.Print wb.VBProject.VBComponents.Item(i).Name
' Debug.Print wb.VBProject.VBComponents.Item(i).Type
If wb.VBProject.VBComponents.Item(i).CodeModule.Count OfLines 2
Then
lngLines = lngLines + wb.VBProject.VBComponents.Item
(i).CodeModule.CountOfLines
End If
Next i
CountLines = lngLines
End Function


Regards,
Tom
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory Issues with Excel Terry Excel Programming 0 July 9th 07 02:12 PM
Excel Memory Issues TXSteveO Excel Discussion (Misc queries) 4 January 1st 07 01:26 AM
memory issues Spike Excel Programming 3 December 17th 05 09:53 AM
memory issues with Excel raj Excel Programming 1 September 19th 03 01:32 PM
Memory Issues keepitcool Excel Programming 0 August 25th 03 02:47 AM


All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"