Excel limits?

Expiry

Well-known Member
Joined
Jun 20, 2007
Messages
865
In a discussion about file storage, I jokingly said to a colleague that we should just save every file as book1, book2 etc.

That got me wondering what Excel's limit is. If I open a new file, it's book1, the next is book2.

Is there a limit?

What's the furthest you've ever got to (ooh, err).
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Well I don't think there's a limit in terms of file / workbook names. But the # of workbooks you can open is limited by memory. As is the number of sheets you can have in a workbook.
 
If you open a new book you get Book1, the next new book you open is Book2, if you then close Book1 (to avoid memory limits) and open another new one you get Book3 .... probably ad infinitum - well at least until you get very bored :biggrin:
 
Why not find out?

All you should need to do is loop some simple code.

You could even try passing it off as 'research' or something.:)
 
Or explode, spontaneously combust, or both.

I know my laptop would do the latter if given the chance.:)
 
I believe it should throw "Out of memory" error, or similar.

I don't fancy testing it, but if anyone wants to:
Code:
Public Sub SuperBored()
    Dim wkb As Workbook
    
    On Error GoTo err_exit
    Do
        Workbooks.Add
    Loop
    
err_exit:
    For Each wkb In Workbooks
        If Not wkb Is ThisWorkbook Then
            If Workbooks.Count = 2 Then
                MsgBox "Last workbook created: " & wkb.Name
            Else
                wkb.Close SaveChanges:=False
            End If
        End If
    Next wkb
End Sub
 
Or explode, spontaneously combust, or both.

I know my laptop would do the latter if given the chance.:)

Code:
Public Sub NoriesFieryLoop()
Dim SafetyLimit as Distance
Do
StepAway = StepAway + 1
'Place your Fiery Code here
While SafetyLimit < msoSafeDistance
End Sub
 
I'm not scared...

I ran the code and got to Book697, before, I got the following message.

"Excel cannot complete this task with available resources. Choose less data or close other applications."

The only Apps open was an RDP link to an external server.

Oh, and I have 12GB of RAM onboard.

:)
 

Forum statistics

Threads
1,222,622
Messages
6,167,127
Members
452,098
Latest member
xel003

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top