Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Export of table to Excel

    Dear All,

    I am using -tab2xl- to export some tables to Excel.

    I encounter the following message:
    could not write cell format bold() to file
    The error code is: 691.

    Tracing shows that the statement being executed is:
    Code:
          - qui putexcel `leftColLetter'`row':`leftColLetter'`lastRow', bold
          = qui putexcel A2:A86, bold
    which corresponds to line 138 of the tab2xl.ado source file.

    The command I tried to execute was:

    Code:
    tab2xl R1__id f1 using "C:\temp\us.xls", percentage sheet("r1", replace) replace row(1) col(1)
    and a simpler
    Code:
    tab2xl R1__id f1 using "C:\temp\us.xls", row(1) col(1)
    Both variables mentioned in the command are numerical integer labelled variables, observations count is 409.

    tab2xl is a command written by Kevin Crow (StataCorp)
    the version was installed today.
    Checksum for c:\ado\plus/t/tab2xl.ado = 3430602164, size = 43628
    [9] package tab2xl from http://www.stata.com/users/kcrow
    tab2xl. exports tabulation tables to MS Excel.

    Stata is:
    StataNow/MP 18.5 for Windows (64-bit x86-64)
    Revision 16 Oct 2024
    Current update level: 16 Oct 2024


    Is this a problem of Stata or tab2xl?
    What needs to be adjusted for the command to succeed?

    Thank you, Sergiy



  • #2
    Update: the problem seems to be not related to my data at all and is reproducible with the standard dataset used for examples: auto.dta:

    Code:
    clear all
    sysuse auto
    tab2xl price foreign using "C:\temp\t2x.xls", row(1) col(1) replace percentage

    Code:
    . tab2xl price foreign using "C:\temp\t2x.xls", row(1) col(1) replace percentage
    could not write cell format bold() to file
    
    r(691);
    I believe it could be related to the number of cell formats used in the file, see here. (but this is not confirmed).

    Best, Sergiy

    Comment


    • #3
      I can replicate the problem. No clue.

      Comment


      • #4
        Dear George Ford , thank you very much for confirming. I can see that the command still works in general, but not reliably, and failing with some input data/parameters. I hope it is possible to get a version that can be more robust. In the meanwhile I ended up reprogramming this from scratch to output the tables I need into PDF. Took more time than taking off-the-shelve tool, but more control over the formatting that I want came in return. Best, Sergiy

        Comment

        Working...
        X