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: 7
Default Reduce file size by removing comments from code?

Hello,
I've been working on a spreadsheet to be used for requesting changes in
access to "Systems" (Email, network login, and other applications requiring a
login, as well as VoiceMail, physical keys, etc). The core functionality of
this tool is to get the spreadsheet to the right System Administrators via
Excel's Routing Slip feature. Aside from a few minor details, the
spreadsheet is finished. However, the file is being sent to multiple
recipients, and therefore takes up a significant amount of space in the Email
system (250k+ per recipient, per request form). For this reason, I am
working on a tool (also written in Excel/VBA) that removes all the comments,
blank lines, and leading white-space from the 1500+ lines of code.
At first, Excel would crash every time. I found out that Excel does NOT
like it when some code causes the header for any function (even one in
another WorkBook) to be replaced, even when replaced with the exact same line
of code. Naturally, I modified the code so it doesn't touch lines that have
no leading white-space and made sure I put no comments on those lines. The
code worked fine when there were only about 1000 lines of code; but now it
causes Excel to freeze up, usually on a "debug.print" line.
I've found that adding a "Stop" statement that only executes once
(after removing the comments from half of the VBComponents), then stepping
through one or more lines, I can let the code Run (F5) and complete the task.
The placement or timing of the Stop statement don't seem to make much
difference, as long as the code doesn't process more than 1000 lines without
a Stop. Maybe the VBA engine just gets tired? heheh.
Any ideas why Excel would freeze up/stop responding/etc (but not crash)
when using ReplaceLine and DeleteLine on the CodeModule for a VBComponent in
a separate WorkBook? Any suggestions on a work-around or other method for
removing the comments? ANY help would be most welcome!

-Shadhi

P.S. I've tried using "DoEvents" after before/after processing each
VBComponent, and also adding an "Application.Wait" line instead of the Stop.
The ONLY thing that seems to work is causing VBA to Step (F8) through at
least one line in the middle of the process.
 
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
Reduce File size Jeremy Ng Excel Discussion (Misc queries) 4 May 12th 09 11:50 PM
Reduce File Size shakey1181 Excel Discussion (Misc queries) 5 July 30th 08 11:55 PM
how to set sheet size to reduce file size LJ Excel Discussion (Misc queries) 1 November 26th 06 02:35 AM
reduce file size Cruz Excel Discussion (Misc queries) 2 October 6th 06 11:14 PM
Reduce size file tempêtje Excel Discussion (Misc queries) 2 March 29th 05 12:19 PM


All times are GMT +1. The time now is 12:58 AM.

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

About Us

"It's about Microsoft Excel"