Max PrintArea line length in Excel

What is the maximum printArea string length in Excel 2003 and 2010?

I have a PrintArea 677 string length.

This causes an error in Excel 2003, but not in 2010, so I would like to know what the maximum row length will be in both versions, as well as in 2007.

+6
source share
1 answer

The limit in 2003 and 2007 is 255 characters.

I don't have a 2010 copy for testing, but you can use this VBA code to easily test it. Just run the macro and after it crashes, go to Debug and check the value of i. Less than this will be the maximum string length.

Sub PrintRangeTest() Dim i As Integer Dim j As Integer Dim newName As String newName = "" Dim rng As Range For i = 1 To 100000 //some arbitrarily large number newName = "" For j = 1 To i newName = newName & "a" Next Set rng = ActiveSheet.Range(Cells(1, 1), Cells(i, i)) rng.Name = newName ActiveSheet.PageSetup.PrintArea = rng Next End Sub 
+4
source

Source: https://habr.com/ru/post/888192/


All Articles