[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: exporting results

From   "Buzz Burhans" <>
To   <>
Subject   RE: st: exporting results
Date   Fri, 04 Apr 2008 08:19:10 -0400

Chris -

I use a variation on Jeph's strategy for some reports I need to reproduce
regularly by running the same -do- files.  Instead of copy/paste the table
into Excel as Jeph does, using Stata I generate *.txt files containing the
appropriate tables (or multiple parts of them).  Then I use the data>import
external data  menu of Excel to import the table(s) -thus a single table in
Excel can actually contain multiple "tables" imported as separate *.txt
files.  In Excel I format the tables extensively, including conditional
formatting.  During the import process I save the import query with the
"prompt for file" unchecked.  Then I save the workbook.  Next time I open it
(after I have rerun data through Stata and regenerated the *.txt files) it
automatically refreshes the txt imports, so I immediately have updated and
formatted tables.

When I print it, however, I use Word.  In word I copy the formatted Excel
table in as a "past special" link Excel worksheet object (not a straight
"paste" in).  Once the Word file is saved, after the Excel file is refreshed
the next time, the Word file automatically reflects the changes to the

I print the pages from Word rather than from Excel mostly because I use
graphs generated in Stata in the reports that also need to be refreshed. In
Word I can insert graphs generated in Stata, and they will also be refreshed
when the Word document reopens (inserted pictures (graphs)  will not refresh
in Excel 2003).  To add Stata graphs that refresh to the Word document, I
export them in Stata as *.wmf files. Then I insert them as a picture link
(not as a picture) in the Word document. While these graphs can be placed in
Excel similarly, the links will not update in Excel, but they will in Word. 

Now I have a Word document that is automatically updated with output
generated by data, tables, and graphs from the most recent run of my Stata


Buzz Burhans, Ph.D.

Dairy-Tech Group

Twin Falls, ID
Phone: 208-320-0829
Fax: 208-735-1289 

So. Albany VT
Phone: 802-755-6842


-----Original Message-----
[] On Behalf Of Jeph Herrin
Sent: Thursday, April 03, 2008 12:35 PM
Subject: Re: st: exporting results

It's an extra step, but I find I get the most satisfying
result by pasting to Excel. Excel copies and links to Word
quite well, and it's easy to drag things around.

Typically, in fact, I paste the output to excel, then mirror
this copied output to another section of the sheet. I can
drag around the columns of this mirror table, format cells,
etc; then if I have to repaste the original output, the
mirrored table is updated automatically. And even if you
haven't linked it to a Word table, it's still trivial to
copy & paste.


Christopher Intemann wrote:
> Hi,
> I always wonder whether there exists a more clever way to export results 
> from stata to a table in word than typing.
> Neither the copy, copy table nor copy as html command gives satisfying 
> results.
> "Copy as pict" looks nice, but, as the content cannot be edited further, 
> is somehow kind of useless...
> Does anyone know a good  export script? It would be great if one could 
> customize the output format, like number of digits etc. as well.
> Thanks,
>  Chris
> *
> *   For searches and help try:
> *
> *
> *
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index