Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Trouble importing an Excel spreadsheet when the desired sheet is not the first sheet
From
Aaron Kirkman <[email protected]>
To
[email protected]
Subject
Re: st: Trouble importing an Excel spreadsheet when the desired sheet is not the first sheet
Date
Wed, 31 Oct 2012 14:18:23 -0500
Hi Steve,
The Excel sheet is stored in the same directory as the do file, which
is currently in the working directory. I still get the error even if I
include the full path name. I wonder if it has something to do with
the copy of Excel this machine is running. When I have a chance I'll
reboot the machine and see if that fixes it, since this machine
restores the computer to a preset image upon every reboot.
Aaron
On Wed, Oct 31, 2012 at 2:12 PM, Steve Nakoneshny <[email protected]> wrote:
> Aaron,
>
> I'm running Stata 12.1 on Mac 10.6.8. I was unable to reproduce this error. As a stab in the dark, is the Excel sheet stored in your working directory? You may want to make absolutely certain by including the full path in the filename.
>
> Steve
>
> On 2012-10-31, at 12:59 PM, Aaron Kirkman wrote:
>
>> Dear Statalist,
>>
>> I'm using Stata 12.1 with the 22 Oct 2012 revision on Windows 7 x64. I
>> need to import data from an excel spreadsheet where the desired sheet
>> is not the first sheet, but the --import excel-- command returns an
>> r(601) error of "Sheet not found."
>>
>> The spreadsheet contains data from the Workforce Investment Act, found
>> at this link:
>>
>> http://www.doleta.gov/budget/docs/110630_wia_spendsum_bypgm_asof_120209_out.xls
>>
>> The sheet I need is titled "DW_Sum". I ran this command:
>>
>> ****
>> import excel "110630_wia_spendsum_bypgm_asof_120209_out.xls",
>> sheet("DW_Sum") clear
>> ****
>>
>> but I get the r(601) error. If I open Excel and move the DW_Sum sheet
>> to a position as the first sheet, the above command works. The same
>> command also works if I remove the --sheet-- option all together
>> (assuming I've moved DW_Sum to be the first sheet).
>>
>> Can anyone reproduce this error? In other spreadsheets from the site,
>> i.e. this one:
>>
>> http://www.doleta.gov/budget/docs/101231_WIA_SpendSum_byPgm_asof_110603_OUT.xls
>>
>> I do not have this problem, so I assume this is a problem with this
>> specific spreadsheet, but I want to make sure.
>>
>> Thank you,
>> Aaron
>> *
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/