Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
WHA WHA is offline
external usenet poster
 
Posts: 21
Default Memory problem: Am I hitting the 64K segment boundary?

See also http://www.dailydoseofexcel.com/arch...e-size-limits/

I was interested in knowing whether a specific code module was over
this limit. This was the code module for my main CRUD form. This form
has 16 command buttons (including Edit/Delete/Create for each of five
properties), five combo boxes, two radio buttons, a checkbox and some
labels. Also some empty frames, height 1, used as dividers. There are
1330 lines of code but most of these are commented out.

Per the comments at the above site, I tried
?
len(application.VBE.ActiveCodePane.CodeModule.Line s(1,application.VBE.ActiveCodePane.CodeModule.Coun tOfLines))/
1000

in the Immediate window and got 47.847. (Note for posterity: I first
had to go to Tools/Macro/Security/Trusted Publishers/Trust access to
VB Project.) Is that bad? Is 47.847 the result of compiling the code?
Or, instead, can that number be affected by the user opening/closing/
using the Userform?

Thanks in advance, WHA

Background: I am building a VBA-based tool in Excel 2003 on Windows
XP. I'm having some kind of memory leak problem: I get "Out of
memory," with no mention of Error 7. This can occur simply when I am
in the VBE without any of my code running. Also, after the error
occurs, I am unable to save the workbook, even to a local drive. This
is the third of four posts with questions about what the source of
this error might be.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Memory problem: Am I hitting the 64K segment boundary?

From what you describe, a handful of controls and total length of code 47k
characters in 1330 line including many commented lines does not seem large
at all.
Indeed in XL2002 and later you would have had to tick that security box to
reference the VBIDE, I'm sure unrelated to your problems, no not bad.

It sounds like a problem in your coded leading to memory leaks which can be
problematic to track down.

What does that Delete and Create do

Frames are relatively resource intensive, try removing them, but unless
linked to something else you are doing I'm not optimistic that'll help.

Regards,
Peter T

"WHA" wrote in message
...
See also

http://www.dailydoseofexcel.com/arch...e-size-limits/

I was interested in knowing whether a specific code module was over
this limit. This was the code module for my main CRUD form. This form
has 16 command buttons (including Edit/Delete/Create for each of five
properties), five combo boxes, two radio buttons, a checkbox and some
labels. Also some empty frames, height 1, used as dividers. There are
1330 lines of code but most of these are commented out.

Per the comments at the above site, I tried
?

len(application.VBE.ActiveCodePane.CodeModule.Line s(1,application.VBE.Active
CodePane.CodeModule.CountOfLines))/
1000

in the Immediate window and got 47.847. (Note for posterity: I first
had to go to Tools/Macro/Security/Trusted Publishers/Trust access to
VB Project.) Is that bad? Is 47.847 the result of compiling the code?
Or, instead, can that number be affected by the user opening/closing/
using the Userform?

Thanks in advance, WHA

Background: I am building a VBA-based tool in Excel 2003 on Windows
XP. I'm having some kind of memory leak problem: I get "Out of
memory," with no mention of Error 7. This can occur simply when I am
in the VBE without any of my code running. Also, after the error
occurs, I am unable to save the workbook, even to a local drive. This
is the third of four posts with questions about what the source of
this error might be.



  #3   Report Post  
Posted to microsoft.public.excel.programming
WHA WHA is offline
external usenet poster
 
Posts: 21
Default Memory problem: Am I hitting the 64K segment boundary?

Thank you for the reply -- the Edit/Delete/Create functions are for
records that are stored in a separate Excel workbook ("data
workbook"). The data workbook has tabs for State, City and
Neighborhood, and the main CRUD form has combo boxes for each of these
three items too. (Names changed to protect the innocent.) When the
user changes the State combo box, the system (re)populates the City
combo box; likewise with City and Neighborhood. Next to each combo box
are three buttons: Edit Selected, Delete Selected, and Create New;
these lead to separate UserForms that do the corresponding functions.

Most of the edit/delete/create functions are commented out as of now
(so clicking most of the buttons does nothing) - and I still got the
out-of-memory error.

I have more info at http://tinyurl.com/374w7w ("Memory problem: Out of
Memory and cannot save") on possible sources of the memory leak.

On Nov 30, 5:49 am, "Peter T" <peter_t@discussions wrote:
From what you describe, a handful of controls and total length of code 47k
characters in 1330 line including many commented lines does not seem large
at all.
Indeed in XL2002 and later you would have had to tick that security box to
reference the VBIDE, I'm sure unrelated to your problems, no not bad.

It sounds like a problem in your coded leading to memory leaks which can be
problematic to track down.

What does that Delete and Create do

Frames are relatively resource intensive, try removing them, but unless
linked to something else you are doing I'm not optimistic that'll help.

Regards,
Peter T

"WHA" wrote in message

... See also

http://www.dailydoseofexcel.com/arch...e-size-limits/

I was interested in knowing whether a specific code module was over
this limit. This was the code module for my main CRUD form. This form
has 16 command buttons (including Edit/Delete/Create for each of five
properties), five combo boxes, two radio buttons, a checkbox and some
labels. Also some empty frames, height 1, used as dividers. There are
1330 lines of code but most of these are commented out.


Per the comments at the above site, I tried
?


len(application.VBE.ActiveCodePane.CodeModule.Line s(1,application.VBE.Active
CodePane.CodeModule.CountOfLines))/

1000


in the Immediate window and got 47.847. (Note for posterity: I first
had to go to Tools/Macro/Security/Trusted Publishers/Trust access to
VB Project.) Is that bad? Is 47.847 the result of compiling the code?
Or, instead, can that number be affected by the user opening/closing/
using the Userform?


Thanks in advance, WHA


Background: I am building a VBA-based tool in Excel 2003 on Windows
XP. I'm having some kind of memory leak problem: I get "Out of
memory," with no mention of Error 7. This can occur simply when I am
in the VBE without any of my code running. Also, after the error
occurs, I am unable to save the workbook, even to a local drive. This
is the third of four posts with questions about what the source of
this error might be.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Memory problem: Am I hitting the 64K segment boundary?

I vaguely get the gist from those other threads. Maybe, as you suspect, you
are not releasing your form objects correctly. In your other thread it might
be an idea show how they are opened & closed.

Regards,
Peter T

"WHA" wrote in message
...
Thank you for the reply -- the Edit/Delete/Create functions are for
records that are stored in a separate Excel workbook ("data
workbook"). The data workbook has tabs for State, City and
Neighborhood, and the main CRUD form has combo boxes for each of these
three items too. (Names changed to protect the innocent.) When the
user changes the State combo box, the system (re)populates the City
combo box; likewise with City and Neighborhood. Next to each combo box
are three buttons: Edit Selected, Delete Selected, and Create New;
these lead to separate UserForms that do the corresponding functions.

Most of the edit/delete/create functions are commented out as of now
(so clicking most of the buttons does nothing) - and I still got the
out-of-memory error.

I have more info at http://tinyurl.com/374w7w ("Memory problem: Out of
Memory and cannot save") on possible sources of the memory leak.

On Nov 30, 5:49 am, "Peter T" <peter_t@discussions wrote:
From what you describe, a handful of controls and total length of code

47k
characters in 1330 line including many commented lines does not seem

large
at all.
Indeed in XL2002 and later you would have had to tick that security box

to
reference the VBIDE, I'm sure unrelated to your problems, no not bad.

It sounds like a problem in your coded leading to memory leaks which can

be
problematic to track down.

What does that Delete and Create do

Frames are relatively resource intensive, try removing them, but unless
linked to something else you are doing I'm not optimistic that'll help.

Regards,
Peter T

"WHA" wrote in message


...
See also

http://www.dailydoseofexcel.com/arch...e-size-limits/

I was interested in knowing whether a specific code module was over
this limit. This was the code module for my main CRUD form. This form
has 16 command buttons (including Edit/Delete/Create for each of five
properties), five combo boxes, two radio buttons, a checkbox and some
labels. Also some empty frames, height 1, used as dividers. There are
1330 lines of code but most of these are commented out.


Per the comments at the above site, I tried
?



len(application.VBE.ActiveCodePane.CodeModule.Line s(1,application.VBE.Active
CodePane.CodeModule.CountOfLines))/

1000


in the Immediate window and got 47.847. (Note for posterity: I first
had to go to Tools/Macro/Security/Trusted Publishers/Trust access to
VB Project.) Is that bad? Is 47.847 the result of compiling the code?
Or, instead, can that number be affected by the user opening/closing/
using the Userform?


Thanks in advance, WHA


Background: I am building a VBA-based tool in Excel 2003 on Windows
XP. I'm having some kind of memory leak problem: I get "Out of
memory," with no mention of Error 7. This can occur simply when I am
in the VBE without any of my code running. Also, after the error
occurs, I am unable to save the workbook, even to a local drive. This
is the third of four posts with questions about what the source of
this error might be.




  #5   Report Post  
Posted to microsoft.public.excel.programming
WHA WHA is offline
external usenet poster
 
Posts: 21
Default Memory problem: Am I hitting the 64K segment boundary?

(continuing in this thread for clarity) I thought I did show how the
userforms are opened&closed? I wrote

(NB: I use "<form name.Show" to load the forms, then "Unload Me" from
within each form to close. For object variables (except possibly the
Userform object variables - see my previous post), I set them to
Nothing at the end of every procedure.)

The previous post is at http://tinyurl.com/29nzfz -- briefly, it's
about whether I ought to define, set, then clear an object variable
for a userform as opposed to just using "UserForm1.Show" and "Unload
Me."

On Nov 30, 9:56 am, "Peter T" <peter_t@discussions wrote:
I vaguely get the gist from those other threads. Maybe, as you suspect, you
are not releasing your form objects correctly. In your other thread it might
be an idea show how they are opened & closed.

Regards,
Peter T

"WHA" wrote in message

...

Thank you for the reply -- the Edit/Delete/Create functions are for
records that are stored in a separateExcelworkbook ("data
workbook"). The data workbook has tabs for State, City and
Neighborhood, and the main CRUD form has combo boxes for each of these
three items too. (Names changed to protect the innocent.) When the
user changes the State combo box, the system (re)populates the City
combo box; likewise with City and Neighborhood. Next to each combo box
are three buttons: Edit Selected, Delete Selected, and Create New;
these lead to separate UserForms that do the corresponding functions.


Most of the edit/delete/create functions are commented out as of now
(so clicking most of the buttons does nothing) - and I still got the
out-of-memoryerror.


I have more info athttp://tinyurl.com/374w7w("Memoryproblem: Out of
Memoryand cannot save") on possible sources of thememoryleak.


On Nov 30, 5:49 am, "Peter T" <peter_t@discussions wrote:
From what you describe, a handful of controls and total length of code

47k
characters in 1330 line including many commented lines does not seem

large
at all.
Indeed in XL2002 and later you would have had to tick that security box

to
reference the VBIDE, I'm sure unrelated to your problems, no not bad.


It sounds like a problem in your coded leading tomemoryleaks which can

be
problematic to track down.


What does that Delete and Create do


Frames are relatively resource intensive, try removing them, but unless
linked to something else you are doing I'm not optimistic that'll help.


Regards,
Peter T


"WHA" wrote in message


...
See also

http://www.dailydoseofexcel.com/arch...e-size-limits/


I was interested in knowing whether a specific code module was over
this limit. This was the code module for my main CRUD form. This form
has 16 command buttons (including Edit/Delete/Create for each of five
properties), five combo boxes, two radio buttons, a checkbox and some
labels. Also some empty frames, height 1, used as dividers. There are
1330 lines of code but most of these are commented out.


Per the comments at the above site, I tried
?


len(application.VBE.ActiveCodePane.CodeModule.Line s(1,application.VBE.Active

CodePane.CodeModule.CountOfLines))/


1000


in the Immediate window and got 47.847. (Note for posterity: I first
had to go to Tools/Macro/Security/Trusted Publishers/Trust access to
VB Project.) Is that bad? Is 47.847 the result of compiling the code?
Or, instead, can that number be affected by the user opening/closing/
using theUserform?


Thanks in advance, WHA


Background: I am building a VBA-based tool inExcel2003 on Windows
XP. I'm having some kind ofmemoryleak problem: I get "Out of
memory," with no mention of Error 7. This can occur simply when I am
in the VBE without any of my code running. Also, after the error
occurs, I am unable to save the workbook, even to a local drive. This
is the third of four posts with questions about what the source of
this error might be.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Memory problem: Am I hitting the 64K segment boundary?

My original response was to answer that IMO the overall size of your form,
code & controls, was in no way excessive. I admit thereafter I may not have
fully absorbed all of the various threads. However use of "Unload Me"
doesn't necessarily release destroy the form. Set obj = Nothing will
disconnect the reference from the object but would only destroy the object
if there are no other references to the object. IOW so what you had revealed
is not really enough to confirm either way.

Sometimes those references are not obvious, eg if a second form is launched
from the first you can't destroy the first form until unloading the second
(with modal forms). It may well be that there's nothing wrong at all with
your method to destroy the forms, problems may well stem from elsewhere. Try
adding the following to all your forms -

Private Sub UserForm_Initialize()
Debug.Print "Initialize " & Me.Name
End Sub

Private Sub UserForm_Terminate()
Debug.Print "Terminate " & Me.Name
End Sub

You should get matching pairs.

Regards,
Peter T

"WHA" wrote in message
...
(continuing in this thread for clarity) I thought I did show how the
userforms are opened&closed? I wrote

(NB: I use "<form name.Show" to load the forms, then "Unload Me" from
within each form to close. For object variables (except possibly the
Userform object variables - see my previous post), I set them to
Nothing at the end of every procedure.)

The previous post is at http://tinyurl.com/29nzfz -- briefly, it's
about whether I ought to define, set, then clear an object variable
for a userform as opposed to just using "UserForm1.Show" and "Unload
Me."

On Nov 30, 9:56 am, "Peter T" <peter_t@discussions wrote:
I vaguely get the gist from those other threads. Maybe, as you suspect,

you
are not releasing your form objects correctly. In your other thread it

might
be an idea show how they are opened & closed.

Regards,
Peter T

"WHA" wrote in message


...

Thank you for the reply -- the Edit/Delete/Create functions are for
records that are stored in a separateExcelworkbook ("data
workbook"). The data workbook has tabs for State, City and
Neighborhood, and the main CRUD form has combo boxes for each of these
three items too. (Names changed to protect the innocent.) When the
user changes the State combo box, the system (re)populates the City
combo box; likewise with City and Neighborhood. Next to each combo box
are three buttons: Edit Selected, Delete Selected, and Create New;
these lead to separate UserForms that do the corresponding functions.


Most of the edit/delete/create functions are commented out as of now
(so clicking most of the buttons does nothing) - and I still got the
out-of-memoryerror.


I have more info athttp://tinyurl.com/374w7w("Memoryproblem: Out of
Memoryand cannot save") on possible sources of thememoryleak.


On Nov 30, 5:49 am, "Peter T" <peter_t@discussions wrote:
From what you describe, a handful of controls and total length of

code
47k
characters in 1330 line including many commented lines does not seem

large
at all.
Indeed in XL2002 and later you would have had to tick that security

box
to
reference the VBIDE, I'm sure unrelated to your problems, no not

bad.

It sounds like a problem in your coded leading tomemoryleaks which

can
be
problematic to track down.


What does that Delete and Create do


Frames are relatively resource intensive, try removing them, but

unless
linked to something else you are doing I'm not optimistic that'll

help.

Regards,
Peter T


"WHA" wrote in message



...
See also


http://www.dailydoseofexcel.com/arch...e-size-limits/

I was interested in knowing whether a specific code module was

over
this limit. This was the code module for my main CRUD form. This

form
has 16 command buttons (including Edit/Delete/Create for each of

five
properties), five combo boxes, two radio buttons, a checkbox and

some
labels. Also some empty frames, height 1, used as dividers. There

are
1330 lines of code but most of these are commented out.


Per the comments at the above site, I tried
?



len(application.VBE.ActiveCodePane.CodeModule.Line s(1,application.VBE.Active

CodePane.CodeModule.CountOfLines))/


1000


in the Immediate window and got 47.847. (Note for posterity: I

first
had to go to Tools/Macro/Security/Trusted Publishers/Trust access

to
VB Project.) Is that bad? Is 47.847 the result of compiling the

code?
Or, instead, can that number be affected by the user

opening/closing/
using theUserform?


Thanks in advance, WHA


Background: I am building a VBA-based tool inExcel2003 on Windows
XP. I'm having some kind ofmemoryleak problem: I get "Out of
memory," with no mention of Error 7. This can occur simply when I

am
in the VBE without any of my code running. Also, after the error
occurs, I am unable to save the workbook, even to a local drive.

This
is the third of four posts with questions about what the source of
this error might be.




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
move Excel cell boundary using sort ? william Excel Worksheet Functions 9 December 5th 08 12:37 AM
Getting External Data with Bullying/Boundary problems TATrader Excel Discussion (Misc queries) 4 October 13th 06 01:06 PM
Lower Boundary of Vertical Scrollbar noplasma Excel Discussion (Misc queries) 0 January 5th 06 05:24 PM
Creating Boundary Curves in Excel? Robert H Charts and Charting in Excel 1 December 12th 05 09:32 PM
Problem when hitting an empty cell GPrabaka Excel Programming 5 August 6th 05 12:08 PM


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