Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default out of memory error

i am getting intermittent out of memory errors in vba. it can happen when
hitting return in a module or running review source code from mztools. haven't
seen any other conditions yet.

i've attributed it to using a couple public variables.
Public wb2 As Workbook
Public wb3 As Workbook

i open each workbook in one module and from that module i call another module to
manipulate the data and then close the files and return to the calling module to
finish up. after running the code is when i get the error.

i tried this just to confirm it didn't happen:

i dimmed the 2 workbooks in each module.
i open the files in the first module and then use these lines to set the
variable after i call the 2nd module.
ActiveWindow.ActivatePrevious
Set wb2 = ActiveWorkbook
ActiveWindow.ActivatePrevious
Set wb3 = ActiveWorkbook

have never seen the error using this method.

anyone know why the public variables would be causing me a problem?


--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default out of memory error

tried it on another of my pc's, this one has 0ffice 2003 sp2 and it seems to
work fine. my main pc has office 2003 sp3 on it. this xp install has been
running for over 4 years, maybe it's time to reformat. it's been through quite a
few ms betas, too, so who knows what's going on.

--


Gary


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i am getting intermittent out of memory errors in vba. it can happen when
hitting return in a module or running review source code from mztools. haven't
seen any other conditions yet.

i've attributed it to using a couple public variables.
Public wb2 As Workbook
Public wb3 As Workbook

i open each workbook in one module and from that module i call another module
to manipulate the data and then close the files and return to the calling
module to finish up. after running the code is when i get the error.

i tried this just to confirm it didn't happen:

i dimmed the 2 workbooks in each module.
i open the files in the first module and then use these lines to set the
variable after i call the 2nd module.
ActiveWindow.ActivatePrevious
Set wb2 = ActiveWorkbook
ActiveWindow.ActivatePrevious
Set wb3 = ActiveWorkbook

have never seen the error using this method.

anyone know why the public variables would be causing me a problem?


--


Gary





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default out of memory error

Hi Gary, that memory thing usually happens when you have a series of
procedures that store variables without an intevening dump. Public variables
are not necessarily a cause but if you are stacking variables somewhere, it
will definitely eat up memory.

"Gary Keramidas" wrote:

i am getting intermittent out of memory errors in vba. it can happen when
hitting return in a module or running review source code from mztools. haven't
seen any other conditions yet.

i've attributed it to using a couple public variables.
Public wb2 As Workbook
Public wb3 As Workbook

i open each workbook in one module and from that module i call another module to
manipulate the data and then close the files and return to the calling module to
finish up. after running the code is when i get the error.

i tried this just to confirm it didn't happen:

i dimmed the 2 workbooks in each module.
i open the files in the first module and then use these lines to set the
variable after i call the 2nd module.
ActiveWindow.ActivatePrevious
Set wb2 = ActiveWorkbook
ActiveWindow.ActivatePrevious
Set wb3 = ActiveWorkbook

have never seen the error using this method.

anyone know why the public variables would be causing me a problem?


--


Gary




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default out of memory error

thanks jl.

--


Gary


"JLGWhiz" wrote in message
...
Hi Gary, that memory thing usually happens when you have a series of
procedures that store variables without an intevening dump. Public variables
are not necessarily a cause but if you are stacking variables somewhere, it
will definitely eat up memory.

"Gary Keramidas" wrote:

i am getting intermittent out of memory errors in vba. it can happen when
hitting return in a module or running review source code from mztools.
haven't
seen any other conditions yet.

i've attributed it to using a couple public variables.
Public wb2 As Workbook
Public wb3 As Workbook

i open each workbook in one module and from that module i call another module
to
manipulate the data and then close the files and return to the calling module
to
finish up. after running the code is when i get the error.

i tried this just to confirm it didn't happen:

i dimmed the 2 workbooks in each module.
i open the files in the first module and then use these lines to set the
variable after i call the 2nd module.
ActiveWindow.ActivatePrevious
Set wb2 = ActiveWorkbook
ActiveWindow.ActivatePrevious
Set wb3 = ActiveWorkbook

have never seen the error using this method.

anyone know why the public variables would be causing me a problem?


--


Gary






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
getting error out of memory Hilda Excel Programming 1 January 12th 06 06:34 PM
How to handle error 8007000e Memory Error L. A. M. Excel Programming 6 June 28th 05 04:05 AM
Out of Memory Error Edgar Thoemmes Excel Programming 1 January 25th 04 01:52 PM
Out of memory error JJ[_6_] Excel Programming 1 January 23rd 04 03:29 PM
out of memory error rosanne Excel Programming 2 July 16th 03 06:21 AM


All times are GMT +1. The time now is 02:28 PM.

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"