none
Are Powerpoint tables restricted to a maximum number of columns? RRS feed

  • Question

  • I am preparing an automated solution to a problem involving the creation of a Powerpoint 2007 presentation via VS2008 and the Office Open XML SDK.

    In short, I am using C-Sharp to create a simple table of years decomposed into months along the top, with various events down the side. Each month gets its own column in the table. In my efforts, what I have discovered is that there are apparently undocumented (?) limits to the dimensions of the tables in PowerpointML.

    My current routine creates a simple table that covers a two-year span, which works perfectly. I then attempted to extend this by creating a third year, but doing so results in the creation of a presentation that Powerpoint claims is "corrupted" even though it passes the Validate method with no errors.

    I have manually tried to create a table from scratch in PowerPoint 2007, and have found that I am restricted to no more than 75 columns when I specify the table's dimensions. I know I am not yet reaching this limit in my sample - in fact, my sample creates a three-year period that should create no more than 37 columns. Yet I strongly suspect I am simply encountering a different variety of the same problem. I'm assuming that since my PresentationML is not inherently column-constrained when creating the table, Powerpoint simply reaches its internal column limit as it reads in the created file and crashes.

    I have Googled for any documented limits on table dimensions in PowerpointML, but have found none. Any further information on this problem, or possible solutions to overcome it, would be greatly appreciated.

    -David

     

    • Moved by Cindy Meister MVPModerator Monday, October 11, 2010 8:46 PM not VSTO-related (From:Visual Studio Tools for Office)
    • Edited by soonerdave Tuesday, October 12, 2010 1:43 PM wanted to point out the "corrupt" document passes validation
    Monday, October 11, 2010 8:40 PM

Answers

  • I have discovered the source of the problem that inspired my post.

    The embedded column count within the generated Powerpoint was not , in fact, the reason the application saw the file as corrupt. The actual problem was that the computed width for the month columns in the table was smaller than the smallest allowable column width in Powerpoint.

    When creating tables in PowerPoint conventionally, the smallest width I could define was 0.23". Any attempt to make a smaller width was adjusted in the GUI (under Table Layout - Cell Width) back to 0.23". I noted that the width computed for the month columns in the "corrupt" presentations was on the order of 215000. When I forced the minimum value (in code) to be at least 230000, the generated presentations were no longer corrupted.

    On that basis, I amended my program to compute the column widths based on the number of requested years/months, but to establish the minimum possible value to that defined above. If the program determines that forcing the column widths causes the table to exceed the page's width, a warning is issued as the presentation is generated. A table that exceeds the slide's width will still render and display properly. This change to my program now works with all combinations of years and months I have tried, so I consider the problem solved.

    As it appears there is a minimum allowable value for a table column width, I am a little surprised it is not encoded into the PresentationML schema for validation purposes as a "minValue" such that the Validate() method from the SDK would catch it before the application terminates.

    I don't know if anyone has ever had a need to dive into PresentationML in this way, but just in case they encountered a simlar problem, I thought perhaps my experience might be of benefit.

    -David

     

    • Marked as answer by soonerdave Wednesday, October 13, 2010 7:51 PM
    Wednesday, October 13, 2010 7:51 PM