Bookmark and Share

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   Thu, 1 Nov 2012 16:21:40 -0500

Hi Kevin,

Thank you for letting me know. Opening the Excel file and resaving it
without making any changes worked after a couple of saves.

Aaron

On Thu, Nov 1, 2012 at 3:58 PM, Kevin Crow, StataCorp LP
<[email protected]> wrote:
> Aaron Kirkman <[email protected]> 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
>
>
> We believe there is somthing wrong with the Excel file in
> question.  If Aaron opens the file in Excel and resaves it,
> even without making any changes to it, -import excel- will be
> able to import it into Stata.
>
> For more help, Aaron can contact [email protected].
>
>
> Kevin Crow
> StataCorp
>
>
> *
> *   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index