Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default What is a VBA Cleaner and why using it?

Dear All,

Please, could anybody tell me some more details about the VBA Cleaner?
The fact a program like VBA Cleaner exists doesn't make sense to me.

The only explanation I get is the following:

During the process of creating VBA programs a lot of junk code builds
up in your files. If you don't clean your files periodically you will
begin to experience strange problems caused by this extra baggage.
Cleaning a project involves exporting the contents of all its
VBComponents to text files, deleting the components and then importing
the components back from the text files.

How do I have to imagine this "junk code"? I'm very tidy writing my
code.

Regards,

Bart

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default What is a VBA Cleaner and why using it?

Bart,
The "junk" it removes is not visible to you.
The code you write is not directly read by the computer.
It is converted to a machine readable code during the compile operation.
This is not a perfect process and the module can become bloated.
The more changes you make to the code the larger the module can become.

Many people use the "Cleaner" add-in and are happy with it.
I have had some awful crashes using it and instead copy code to NotePad,
delete the module, insert a new module and then copy the Notepad text back
into the new module.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




wrote in message
Dear All,
Please, could anybody tell me some more details about the VBA Cleaner?
The fact a program like VBA Cleaner exists doesn't make sense to me.

The only explanation I get is the following:

During the process of creating VBA programs a lot of junk code builds
up in your files. If you don't clean your files periodically you will
begin to experience strange problems caused by this extra baggage.
Cleaning a project involves exporting the contents of all its
VBComponents to text files, deleting the components and then importing
the components back from the text files.

How do I have to imagine this "junk code"? I'm very tidy writing my
code.
Regards,
Bart

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default What is a VBA Cleaner and why using it?

To add to Jim's answer:
The code you write in the VBE is the only part visible/accessible to you.
However, there are a further 2 (or 3?) stages before the code actually gets
executed. Depending on what you done and if the code has ever been compiled,
your file may contain this code in various stages of compilation stored with
it. Continual editing can leave bits of this intermediate code laying around
in the file, which leads to bloat.
Copying the text of the code out, either manually or with something like
CodeCleaner, and pasting back into a new module, removes all the previous
(partly) compiled code.

Apart from keeping the file small and reliable, this can be useful in
certain situations when you want/need to workaround compilation problems, as
the code then has never been compiled. But that is another subject
altogether.

NickHK

wrote in message
oups.com...
Dear All,

Please, could anybody tell me some more details about the VBA Cleaner?
The fact a program like VBA Cleaner exists doesn't make sense to me.

The only explanation I get is the following:

During the process of creating VBA programs a lot of junk code builds
up in your files. If you don't clean your files periodically you will
begin to experience strange problems caused by this extra baggage.
Cleaning a project involves exporting the contents of all its
VBComponents to text files, deleting the components and then importing
the components back from the text files.

How do I have to imagine this "junk code"? I'm very tidy writing my
code.

Regards,

Bart



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default What is a VBA Cleaner and why using it?

Here's an example : declare a series of module level variable - say
private mstrmyString1 as string
....
private mstrmyString100 as string

Now, this will make the human readable code larger - there are now 100 lines
of code. Compile this code and you will see that the workbook gains in size
as the compiled code is stored in the book. Now, delete the variables and
recompile. You will not get the file back to the original size. Why?
Because the compiled representation of the declared variables will not be
removed. Hence the "bloat". I am not a fan of code cleaner but I do
recommend stripping all code and worksheets to a new workbook before
releasing to production - that's basically what code cleaner does but i
prefer to do it manually.

Hope that helps.

--
http://www.alignment-systems.com


" wrote:

Dear All,

Please, could anybody tell me some more details about the VBA Cleaner?
The fact a program like VBA Cleaner exists doesn't make sense to me.

The only explanation I get is the following:

During the process of creating VBA programs a lot of junk code builds
up in your files. If you don't clean your files periodically you will
begin to experience strange problems caused by this extra baggage.
Cleaning a project involves exporting the contents of all its
VBComponents to text files, deleting the components and then importing
the components back from the text files.

How do I have to imagine this "junk code"? I'm very tidy writing my
code.

Regards,

Bart


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default What is a VBA Cleaner and why using it?

Many thanks for your replies. Makes it much more clear to me. Still
though it's a bit strange phenomenon to me: I have understanding for
the phenomenon (my code isn't 100% bug-free neither), but then a third
party piece of software (or yourself) has to take care of this... ?

I just used VBA Cleaner for the first time after a month working full
time on a project. For as far I know I hadn't any problems compiling.
(It was just bad luck for me, because cleaning didn't solve my spooky
problem with the ControlSources. But that's maybe another thread worth
it..)
I make sure to clean the files before delivery. Thanks again.

Bart



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default What is a VBA Cleaner and why using it?

my thanks to all of you for explaining this, also! i've always
wondered about this, especially since (when i'm done) my code is also
tidy & neat..... i didn't realize there was behind-the-scenes stuff
going on.
but i think i'd feel more comfortable with the copying to notepad,
delete module, insert new & recopy code.

might also explain why some of my very complicated & hard to write (to
me) codes run so slowly - finished code is not that long but there
were LOTS of rewrites.
:)
susan


On May 11, 5:32 am, wrote:
Many thanks for your replies. Makes it much more clear to me. Still
though it's a bit strange phenomenon to me: I have understanding for
the phenomenon (my code isn't 100% bug-free neither), but then a third
party piece of software (or yourself) has to take care of this... ?

I just used VBA Cleaner for the first time after a month working full
time on a project. For as far I know I hadn't any problems compiling.
(It was just bad luck for me, because cleaning didn't solve my spooky
problem with the ControlSources. But that's maybe another thread worth
it..)
I make sure to clean the files before delivery. Thanks again.

Bart



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default What is a VBA Cleaner and why using it?

i have a question, tho..........
if you don't use a commercial code cleaner, how do you clean userforms
& worksheet codes????
well, worksheet codes i can see you could copy & paste everything into
a new sheet, including the data. but userforms?
:)
susan


On May 11, 8:57 am, Susan wrote:
my thanks to all of you for explaining this, also! i've always
wondered about this, especially since (when i'm done) my code is also
tidy & neat..... i didn't realize there was behind-the-scenes stuff
going on.
but i think i'd feel more comfortable with the copying to notepad,
delete module, insert new & recopy code.

might also explain why some of my very complicated & hard to write (to
me) codes run so slowly - finished code is not that long but there
were LOTS of rewrites.
:)
susan

On May 11, 5:32 am, wrote:



Many thanks for your replies. Makes it much more clear to me. Still
though it's a bit strange phenomenon to me: I have understanding for
the phenomenon (my code isn't 100% bug-free neither), but then a third
party piece of software (or yourself) has to take care of this... ?


I just used VBA Cleaner for the first time after a month working full
time on a project. For as far I know I hadn't any problems compiling.
(It was just bad luck for me, because cleaning didn't solve my spooky
problem with the ControlSources. But that's maybe another thread worth
it..)
I make sure to clean the files before delivery. Thanks again.


Bart- Hide quoted text -


- Show quoted text -



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default What is a VBA Cleaner and why using it?

What Code Cleaner does is Export the components (modules and userforms),
removes them, saves the file, then reimports the components. As far as I
know, it ignores the code behind sheets and workbooks.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Susan" wrote in message
oups.com...
i have a question, tho..........
if you don't use a commercial code cleaner, how do you clean userforms
& worksheet codes????
well, worksheet codes i can see you could copy & paste everything into
a new sheet, including the data. but userforms?
:)
susan


On May 11, 8:57 am, Susan wrote:
my thanks to all of you for explaining this, also! i've always
wondered about this, especially since (when i'm done) my code is also
tidy & neat..... i didn't realize there was behind-the-scenes stuff
going on.
but i think i'd feel more comfortable with the copying to notepad,
delete module, insert new & recopy code.

might also explain why some of my very complicated & hard to write (to
me) codes run so slowly - finished code is not that long but there
were LOTS of rewrites.
:)
susan

On May 11, 5:32 am, wrote:



Many thanks for your replies. Makes it much more clear to me. Still
though it's a bit strange phenomenon to me: I have understanding for
the phenomenon (my code isn't 100% bug-free neither), but then a third
party piece of software (or yourself) has to take care of this... ?


I just used VBA Cleaner for the first time after a month working full
time on a project. For as far I know I hadn't any problems compiling.
(It was just bad luck for me, because cleaning didn't solve my spooky
problem with the ControlSources. But that's maybe another thread worth
it..)
I make sure to clean the files before delivery. Thanks again.


Bart- Hide quoted text -


- Show quoted text -





Reply
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
Code cleaner WH99 Excel Discussion (Misc queries) 7 July 18th 08 09:15 PM
code cleaner [email protected] Excel Programming 1 April 23rd 07 02:20 PM
Code Cleaner in 2003 Otto Moehrbach[_6_] Excel Programming 2 February 16th 04 06:12 PM
Code Cleaner Jase Excel Programming 1 January 4th 04 11:35 PM
VB Code Cleaner Tim Childs[_6_] Excel Programming 2 December 4th 03 04:06 PM


All times are GMT +1. The time now is 11:21 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"