ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Does excel VBA programme has a size limit? Or some other problems caused this problem? (https://www.excelbanter.com/excel-programming/364762-does-excel-vba-programme-has-size-limit-some-other-problems-caused-problem.html)

[email protected]

Does excel VBA programme has a size limit? Or some other problems caused this problem?
 
I'm currently working on a programme with excel 2003 (communicates with
word...)

Now it has 8 modules and 1 user form (with 576 controls, pretty
big...), totally 161K after exporting.

I noticed that when I open it, run the userform, close userform and
save the excel file...
The size of the excel file can vary from 329K to 427K. (cannot
understand...)

and when the file size is above 400K (approximately), if I run the
program from a button on spreadsheet or from tools menu/Alt+F8, Excel
will crush, need to be closed and want to sent a report to
MS...Heck...But if I open the VBA editor (Alt+F11) then run it (in any
possible ways), most of the times it works perfectly.

So anyone knows what happened? Does it mean that file cannot be larger
that 400K or one form can only have 575 controls? Or there are other
reasons?

Thanks....


RB Smissaert

Does excel VBA programme has a size limit? Or some other problems caused this problem?
 
3 things to think of:
1. Does it have Option Explicit at the top of every module, class module
and form module and with that does it compile?
2. Best to keep the size of any module (when exported) below 64 Kb.
3. Run the free VBA code cleaner:
http://www.appspro.com/Utilities/CodeCleaner.htm

Your file size shouldn't be a problem at all. I have an .xla that is over 5
Mb
and works perfectly fine.

RBS


wrote in message
oups.com...
I'm currently working on a programme with excel 2003 (communicates with
word...)

Now it has 8 modules and 1 user form (with 576 controls, pretty
big...), totally 161K after exporting.

I noticed that when I open it, run the userform, close userform and
save the excel file...
The size of the excel file can vary from 329K to 427K. (cannot
understand...)

and when the file size is above 400K (approximately), if I run the
program from a button on spreadsheet or from tools menu/Alt+F8, Excel
will crush, need to be closed and want to sent a report to
MS...Heck...But if I open the VBA editor (Alt+F11) then run it (in any
possible ways), most of the times it works perfectly.

So anyone knows what happened? Does it mean that file cannot be larger
that 400K or one form can only have 575 controls? Or there are other
reasons?

Thanks....



[email protected]

Does excel VBA programme has a size limit? Or some other problems caused this problem?
 
RB Smissaert wrote:
3 things to think of:
1. Does it have Option Explicit at the top of every module, class module
and form module and with that does it compile?
2. Best to keep the size of any module (when exported) below 64 Kb.
3. Run the free VBA code cleaner:
http://www.appspro.com/Utilities/CodeCleaner.htm

Your file size shouldn't be a problem at all. I have an .xla that is over 5
Mb
and works perfectly fine.

RBS


Thanks...
1. All codes with option explicit from very beginning
2. All modules are smaller than 10K... The form is big (22K codes in
..frm file, but the .frx file is 96K... I don't know if here is the
problem)
3. Code Cleaner need an admin account to install... Trying to get on
now...

I don't think size matters either... I once got an Excel program of
19M...
Today I found if I save the file before running macro, it works
perfectly. so adding ActiveWorkbook.Save is a naive solution...
But I still want to know why Excel behaves like this...(Maybe it is a
compiling error and Excel compiles codes when file saved?) Any hints?


[email protected]

Does excel VBA programme has a size limit? Or some other problems caused this problem?
 
I have a .frx of just over 100 K, so that shouldn't be the problem.
Your best bet is the Code Cleaner and my guess is that that will solve
it.

RBS

wrote:
RB Smissaert wrote:
3 things to think of:
1. Does it have Option Explicit at the top of every module, class module
and form module and with that does it compile?
2. Best to keep the size of any module (when exported) below 64 Kb.
3. Run the free VBA code cleaner:
http://www.appspro.com/Utilities/CodeCleaner.htm

Your file size shouldn't be a problem at all. I have an .xla that is over 5
Mb
and works perfectly fine.

RBS


Thanks...
1. All codes with option explicit from very beginning
2. All modules are smaller than 10K... The form is big (22K codes in
.frm file, but the .frx file is 96K... I don't know if here is the
problem)
3. Code Cleaner need an admin account to install... Trying to get on
now...

I don't think size matters either... I once got an Excel program of
19M...
Today I found if I save the file before running macro, it works
perfectly. so adding ActiveWorkbook.Save is a naive solution...
But I still want to know why Excel behaves like this...(Maybe it is a
compiling error and Excel compiles codes when file saved?) Any hints?




All times are GMT +1. The time now is 03:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com