How to save outputs to different sheets‏ in the same Excel file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to save outputs to different sheets‏ in the same Excel file

haiyan gao
Dear all,
 
Is it possible to save outputs to different sheets in the same Excel file in stata? For example, something like:
outsheet v1 v2 using "M:ABC[sheet 1].xls", replace
outsheet v2 v3 using "M:ABC[sheet 2].xls", replace
 
Your advice will be very much appreciated.
 
Bests wishes,
Haiyan    
_________________________________________________________________
http://clk.atdmt.com/UKM/go/195013117/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|

Re: How to save outputs to different sheets‏ in the same Excel file

nshephard
Administrator
haiyan gao wrote
Dear all,
 
Is it possible to save outputs to different sheets in the same Excel file in stata? For example, something like:
outsheet v1 v2 using "M:ABC[sheet 1].xls", replace
outsheet v2 v3 using "M:ABC[sheet 2].xls", replace
 
This _isn't_ writing Excel sheets.

-outsheet- writes Comma/tab (or user specified) delimited files that are in a style that spreadsheets are capable of reading.

If you were to do...

outsheet v1 v2 using "M:ABC.xls", replace

...and then open the file "M:ABC.xls" in a text-processor (such as Emacs or NotePad) you would be able to see/make sense of the data.  You wouldn't be able to make a lot of sense of a true Excel spreadsheet in a text-editor.

I've little experience with Excel, but you might get some leverage out of using -xmlsave- or some of the other tools returned by the search -findit xml-

Neil
Reply | Threaded
Open this post in threaded view
|

Re: st: How to save outputs to different sheets‏ in the same Excel file

Conor Hughes
In reply to this post by haiyan gao
I'm not sure exactly what you're trying to save, but I know that -
xml_tab - command can output to multiple sheets in a .xml file using
the - sheet(name [, sh_opts]) - option.  It is a user created command
by Zurab Sajaia and Michael Lokshin, available from SSC - ssc install
xml_tab -.

Hopefully this will give you what you're looking for.

- Conor

2010/7/27 haiyan gao <[hidden email]>

>
> Dear all,
>
> Is it possible to save outputs to different sheets in the same Excel file in stata? For example, something like:
> outsheet v1 v2 using "M:ABC[sheet 1].xls", replace
> outsheet v2 v3 using "M:ABC[sheet 2].xls", replace
>
> Your advice will be very much appreciated.
>
> Bests wishes,
> Haiyan
> _________________________________________________________________
> http://clk.atdmt.com/UKM/go/195013117/direct/01/
> We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/



--
Conor Hughes
Mathematics and Economics
University of Chicago 2011

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|

AW: How to save outputs to different sheets‏ in the same Excel file

Martin Weiss-5
In reply to this post by haiyan gao

<>


Stat/Transfer deals with multiple sheets quite neatly in my experience.



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [hidden email]
[mailto:[hidden email]] Im Auftrag von haiyan gao
Gesendet: Dienstag, 27. Juli 2010 11:11
An: [hidden email]
Betreff: st: How to save outputs to different sheets‏ in the same Excel file

Dear all,
 
Is it possible to save outputs to different sheets in the same Excel file in
stata? For example, something like:
outsheet v1 v2 using "M:ABC[sheet 1].xls", replace
outsheet v2 v3 using "M:ABC[sheet 2].xls", replace
 
Your advice will be very much appreciated.
 
Bests wishes,
Haiyan    
_________________________________________________________________
http://clk.atdmt.com/UKM/go/195013117/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us
now
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|

Re: st: How to save outputs to different sheets‏ in the same Excel file

Jeph Herrin-4
In reply to this post by haiyan gao
You may find -odbc- useful; it will allow you to
write to individual excel sheets.

hth,
Jeph

On 7/27/2010 5:10 AM, haiyan gao wrote:

> Dear all,
>
> Is it possible to save outputs to different sheets in the same Excel file in stata? For example, something like:
> outsheet v1 v2 using "M:ABC[sheet 1].xls", replace
> outsheet v2 v3 using "M:ABC[sheet 2].xls", replace
>
> Your advice will be very much appreciated.
>
> Bests wishes,
> Haiyan  
> _________________________________________________________________
> http://clk.atdmt.com/UKM/go/195013117/direct/01/
> We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/