Results 1 to 2 of 2

Thread: Worksheets in Excel - Releasing Memory

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Posts
    406

    Worksheets in Excel - Releasing Memory

    I have done some research and found that the number of worksheets allowed to be created in a workbook is based on the systems memory.

    I have an automated workbook that can, and will, create 200+ worksheets.

    Now, once i get to a certain amount (120 the last time) it just stopped...ven the copy function was looping, no pages were created.

    BUT, when i closed out the workbook, and then re-opened it, and started again, it created the remaining worksheets. So, I am guessing it was 'holding' on to memory as it was going along.

    IS there a way to release any memory it is using when it creates a worksheet, so i don't have to have to close it out, each time, and re-open it?

    FYI: I already have DoEvents in all of my LOOPs.

    I also have this function:

    Code:
    Public Function Holding(Sec As Integer)
        Dim i As Long
        
        If Sec = 0 Then Exit Function
        
        For i = 0 To Sec
            Call Sleep(1000)
            DoEvents
        Next
        
    End Function
    And i use it after each 'grouping' of sheets to be created, wth 5 seconds as the value passed.

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Just a thought, would saving the worksheet solve the problem?

    As another thought, why 200+ sheets in a spreadsheet? Time to move to a database????


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width