Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Re: Stata and Excel


From   "Salvati, Jean" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Re: Stata and Excel
Date   Thu, 4 Nov 2004 17:55:19 -0500

> I have no 
> clue whether Excel is even capable of interacting with a 
> shell OS in that way.

In Excel VB, there's a function called "shell" that allows you to start
another app. 

However, the "shell" function is not as powerful as the C++ function
"CreateProcess". You can ask "CreateProcess" to return just after
starting the app, or to wait for app to exit before returning (in other
words, when the app that you started exits, your C++ program is
notified). 

In contrast, "shell" returns immediately after creating the process, so
you're not notified when the app that you started terminates. SO you
have to use a different trick to determine when the results are
available.

But I'm not a VB expert, so there may be other solutions.

Jean Salvati
Econometric Support
(202) 623-7804
IS 12-1328
 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Wallace, John
> Sent: Thursday, November 04, 2004 5:23 PM
> To: '[email protected]'
> Subject: st: RE: Re: Stata and Excel
> 
> I don't have an answer for Mr Ghulam, but perhaps he's 
> thinking of getting data into Excel from within the Microsoft 
> program.  I know people who use Excel to query databases for 
> example and have the cells linked to graphs, so whenever they 
> update the query the values are automatically reflected in 
> the graphs.  I think what he's looking for is the possibility 
> of invoking stata from Excel, having it process a do-file 
> using data within the Excel sheet, and then having that 
> summarized data appear within the Excel sheet.  I have no 
> clue whether Excel is even capable of interacting with a 
> shell OS in that way.  It uses ODBC to pass information to 
> and from databases though, and Stata is ODBC capable, so 
> perhaps there's some synergistic potential there.
> 
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of 
> Friedrich Huebler
> Sent: Thursday, November 04, 2004 1:54 PM
> To: [email protected]
> Subject: st: Re: Stata and Excel
> 
> Yaseen,
> 
> Your message implies that you have Stat/Transfer. In your 
> do-file, you can save the results as a Stata data file and 
> then convert this file with -stcmd- to an Excel file. This 
> file could then be linked to your other Excel files.
> 
> save results.dta, replace
> stcmd stata results.dta excel results.xls /y
> 
> Friedrich Huebler
> 
> --- Yaseen Ghulam <[email protected]> wrote:
> > Dear Stata users,
> > 
> > Is there anyway of linking stata and MS Excel? I mean we 
> run the model 
> > from our do files, do the predictions and other 
> calculations and excel 
> > get the predicted values direcly from Stata. Our objective is to 
> > present these coefficents and predicted values in excel 
> pivot tables. 
> > One way may be creating log files or coping and pasting or 
> using stat 
> > transfer, but we are interested that excel should get the 
> values in a 
> > way as it gets values from other sheets or excel file.
> > 
> > Yaseen Ghulam
> > Lecturer Banking and Finance
> > University of Portsmouth
> > Economics Department
> > U.K.
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Check out the new Yahoo! Front Page. 
> www.yahoo.com 
>  
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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