Announcement

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

  • Putexcel Issue

    Hello,

    I have a large program in Stata 14 that uses putexcel to output my data into nicely formatted tables and graphs on multiple tabs. I have run into two issues, and they happen at random--they are not due to an error in my code.

    1. Sometimes after opening my excel file and saving it, when I try to re-open the file, I get an error message and all of my data is gone and the majority of the formatting is gone. It's like the file self-destructs.
    2. Some of my formatting doesn't work, at random. For instance, I have bold text, and sometimes the text does not appear bold. But when I click on the cell, the toolbox at the top indicates the cell is bold. Likewise, I have numbers that I round to two decimal places using "number_sep_d2," and sometimes they don't appear rounded in Excel.

    My code does not give me errors related to these issues. One of my theories is that I'm formatting too much from Stata. Has anyone else ran into something similar with putexcel?

    Thanks

  • #2
    Alex,

    1) can you post a minimal example code that would demonstrate the problem?
    2) which format are you using XLS or XLSX? What happens if you switch to an alternative?
    3) which software are you using Stata 14.x.y.z? Which Excel are you using?

    Best, Sergiy

    Comment


    • #3
      Sergiy,

      Thanks for your response.

      1) I try to consolidate my putexcel commands to save time, because each time it is used, the xl file opens and saves. Ex of bold titles (sometimes at random they don't appear bold, but excel toolbar says they are):

      putexcel ///
      B1 = "title1" ///
      B2 = "title2" ///
      ...
      B15 = "title15"
      putexcel B1:B15, font(arial,10) bold hcenter

      2) xlsx. Good idea.
      3) Stata 14.1. Excel 10 and Excel 13 have had the issues.

      Thanks,
      Alex

      Comment

      Working...
      X