none
Table column limit and how this is calculated RRS feed

  • Question

  • Hi all,

    We have came across an issue recently with the max column limit for tables in Word.  First off, is the limit for the maximum number of columns still 63 or has this been changed? Second, how is this calculated?  Is it purely the number of columns that plays into this limit or are there other options/properties that can be set that contribute to this?  For instance does 1 cell that was formed from merging 3 cells count as 1 cell or 3 cells?

    The reason I ask is because we have a template that opens up in Word without any issues, but when we run it through our engine to apply data to it, we have an exception that is thrown (inside of our engine) stating that one of the tables contains more than 63 columns.  Is there a reason we can still open and edit this template with there being more than 63 columns, or is this an issue on our end?

    Thanks for the help,

    Connor

    Monday, June 12, 2017 6:28 PM

Answers

  • Hi Connor Shore,

    I try to make a test with MS Word 2016.

    I find that you can create maximum 63 columns.

    here you can see that I try to create 65 columns but it gives me an error.

    then you had asked,"For instance does 1 cell that was formed from merging 3 cells count as 1 cell or 3 cells?"

    so I try to create another test.

    I try to create one table with 10 columns and 1 row.

    then I merge some cells.

    then I use code below to count cells.

    Sub demo()
    Debug.Print ThisDocument.Tables(1).Rows(1).Cells.Count
    End Sub

    I get output below.

    I try to add another row in which I add 10 columns and try to count cells on 2nd row.

    Sub demo()
    Debug.Print ThisDocument.Tables(1).Rows(2).Cells.Count
    End Sub
     

    Output:

    so you can see that it is displaying the different number of cells according to merge cells in the row.

    but when you try to count the total columns in that table, it will return 10 even if I merged cells.

    Sub demo()
    Debug.Print ThisDocument.Tables(1).Columns.Count
    End Sub
    

    because other rows contains the 10 cells.

    so it is possible that your engine not able to correctly identified the columns in the table and gives you an error.

    you can try to open your template in MS Word and try to count columns and post a picture here. so that we can see if that actually contains more then 63 columns or not.

    Regards

    Deepak 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Tuesday, June 13, 2017 2:03 AM
    Moderator

All replies

  • Hi Connor Shore,

    I try to make a test with MS Word 2016.

    I find that you can create maximum 63 columns.

    here you can see that I try to create 65 columns but it gives me an error.

    then you had asked,"For instance does 1 cell that was formed from merging 3 cells count as 1 cell or 3 cells?"

    so I try to create another test.

    I try to create one table with 10 columns and 1 row.

    then I merge some cells.

    then I use code below to count cells.

    Sub demo()
    Debug.Print ThisDocument.Tables(1).Rows(1).Cells.Count
    End Sub

    I get output below.

    I try to add another row in which I add 10 columns and try to count cells on 2nd row.

    Sub demo()
    Debug.Print ThisDocument.Tables(1).Rows(2).Cells.Count
    End Sub
     

    Output:

    so you can see that it is displaying the different number of cells according to merge cells in the row.

    but when you try to count the total columns in that table, it will return 10 even if I merged cells.

    Sub demo()
    Debug.Print ThisDocument.Tables(1).Columns.Count
    End Sub
    

    because other rows contains the 10 cells.

    so it is possible that your engine not able to correctly identified the columns in the table and gives you an error.

    you can try to open your template in MS Word and try to count columns and post a picture here. so that we can see if that actually contains more then 63 columns or not.

    Regards

    Deepak 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Tuesday, June 13, 2017 2:03 AM
    Moderator
  • The maximum column # in a Word document or template is 63. The count includes cells that are merged/split horizontally, except where all the rows for a given set of cells are merged horizontally - in that case they become a single column.

    The issue you're having is most likely due to your process trying to create/add more columns to a table than the permitted 63.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, June 13, 2017 12:14 PM
  • Excellent! This helped us find our problem.  Thanks for the help,

    Connor

    Wednesday, June 14, 2017 4:12 PM