<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Data from Excel to Stata, take two</title>
	<atom:link href="http://enoriver.net/index.php/2008/11/12/data-from-excel-to-stata-take-two/feed/" rel="self" type="application/rss+xml" />
	<link>http://enoriver.net/index.php/2008/11/12/data-from-excel-to-stata-take-two/</link>
	<description>computing for fun and profit</description>
	<lastBuildDate>Fri, 03 Feb 2012 03:42:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Gabi Huiber</title>
		<link>http://enoriver.net/index.php/2008/11/12/data-from-excel-to-stata-take-two/comment-page-1/#comment-61099</link>
		<dc:creator>Gabi Huiber</dc:creator>
		<pubDate>Fri, 20 Jan 2012 17:39:44 +0000</pubDate>
		<guid isPermaLink="false">http://enoriver.net/?p=290#comment-61099</guid>
		<description>Strange. Let me see if I got this right:

1. You receive a workbook -- .xls or .xlsx, I assume -- from a friend, and &quot;odbc load&quot; is throwing this error. 
2. But you can open that same workbook with your own copy of Excel, so whatever is wrong with it, it&#039;s not something Excel cannot handle. 
3. You then close it, and then run &quot;odbc load&quot;, and all is well.

If all of the above is right, my guess is that the problem is outside Stata, and I have no idea how to fix it. There seems to be some kind of Microsoft-specific mismatch between your friend&#039;s Excel version (say it&#039;s Office 2003) and yours (say it&#039;s Office 2007). Your computer&#039;s ODBC driver can handle files touched by your own Excel version, but it has a hard time with your friend&#039;s.

If you use Stata 12, you may want to try &quot;import excel&quot; instead of &quot;odbc load&quot;.</description>
		<content:encoded><![CDATA[<p>Strange. Let me see if I got this right:</p>
<p>1. You receive a workbook -- .xls or .xlsx, I assume -- from a friend, and "odbc load" is throwing this error.<br />
2. But you can open that same workbook with your own copy of Excel, so whatever is wrong with it, it's not something Excel cannot handle.<br />
3. You then close it, and then run "odbc load", and all is well.</p>
<p>If all of the above is right, my guess is that the problem is outside Stata, and I have no idea how to fix it. There seems to be some kind of Microsoft-specific mismatch between your friend's Excel version (say it's Office 2003) and yours (say it's Office 2007). Your computer's ODBC driver can handle files touched by your own Excel version, but it has a hard time with your friend's.</p>
<p>If you use Stata 12, you may want to try "import excel" instead of "odbc load".</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dadong</title>
		<link>http://enoriver.net/index.php/2008/11/12/data-from-excel-to-stata-take-two/comment-page-1/#comment-61086</link>
		<dc:creator>Dadong</dc:creator>
		<pubDate>Fri, 20 Jan 2012 16:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://enoriver.net/?p=290#comment-61086</guid>
		<description>Hello Gabi: 

Really love your blog. Regularly I have to download some Excel files and load into Stata for data management. I set up odbc connection. But when I try to load it using &quot;odbc load&quot;, it give me the following error message: 

       The ODBC driver reported the following diagnostics
[Microsoft][ODBC Excel Driver] External table is not in the expected format.
SQLSTATE=HY000

However, if I open these excel files using MS Excel,  close it , then use &quot;odbc load&quot; in Stata, there is no problem. Any clue what&#039;s wrong?

Thanks a lot

Dadong</description>
		<content:encoded><![CDATA[<p>Hello Gabi: </p>
<p>Really love your blog. Regularly I have to download some Excel files and load into Stata for data management. I set up odbc connection. But when I try to load it using "odbc load", it give me the following error message: </p>
<p>       The ODBC driver reported the following diagnostics<br />
[Microsoft][ODBC Excel Driver] External table is not in the expected format.<br />
SQLSTATE=HY000</p>
<p>However, if I open these excel files using MS Excel,  close it , then use "odbc load" in Stata, there is no problem. Any clue what's wrong?</p>
<p>Thanks a lot</p>
<p>Dadong</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabi Huiber</title>
		<link>http://enoriver.net/index.php/2008/11/12/data-from-excel-to-stata-take-two/comment-page-1/#comment-1321</link>
		<dc:creator>Gabi Huiber</dc:creator>
		<pubDate>Sun, 02 Aug 2009 20:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://enoriver.net/?p=290#comment-1321</guid>
		<description>I never got around to asking anybody else about this. From your message, it looks like it&#039;s an ODBC driver error, not a Stata error, so I tried to replicate it. 

I had no luck, but since it&#039;s an ODBC drive error, you know that the problem is either in finding the correct workbook, or in finding the correct worksheet. So here&#039;s what I would do:

Change the code below the line that reads &quot;leave this part alone&quot; as follows:
&lt;code&gt;
// first check that Stata found the workbook:
local my_path &quot;`here&#039;`xlsfile&#039;&quot;
capture confirm file &quot;`my_path&#039;&quot;
if _rc==0 {
  di &quot;OK, my Excel file is in the right place.&quot;
}
else {
  di &quot;I am not looking in the right place.&quot;
}
// Next, check that I listed the correct tabs:
di &quot;And these should be my tabs: &quot;
forvalues i=1/`sheetno&#039; {
  local k: word `i&#039; of `sheets&#039;
  di &quot;Tab `i&#039; should be called `k&#039;. Is it?&quot;
} 
&lt;/code&gt;
Running this code should shed some light on what&#039;s wrong. Please let me know how this goes.</description>
		<content:encoded><![CDATA[<p>I never got around to asking anybody else about this. From your message, it looks like it's an ODBC driver error, not a Stata error, so I tried to replicate it. </p>
<p>I had no luck, but since it's an ODBC drive error, you know that the problem is either in finding the correct workbook, or in finding the correct worksheet. So here's what I would do:</p>
<p>Change the code below the line that reads "leave this part alone" as follows:<br />
<code><br />
// first check that Stata found the workbook:<br />
local my_path "`here'`xlsfile'"<br />
capture confirm file "`my_path'"<br />
if _rc==0 {<br />
  di "OK, my Excel file is in the right place."<br />
}<br />
else {<br />
  di "I am not looking in the right place."<br />
}<br />
// Next, check that I listed the correct tabs:<br />
di "And these should be my tabs: "<br />
forvalues i=1/`sheetno' {<br />
  local k: word `i' of `sheets'<br />
  di "Tab `i' should be called `k'. Is it?"<br />
}<br />
</code><br />
Running this code should shed some light on what's wrong. Please let me know how this goes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabi Huiber</title>
		<link>http://enoriver.net/index.php/2008/11/12/data-from-excel-to-stata-take-two/comment-page-1/#comment-1305</link>
		<dc:creator>Gabi Huiber</dc:creator>
		<pubDate>Fri, 31 Jul 2009 11:41:54 +0000</pubDate>
		<guid isPermaLink="false">http://enoriver.net/?p=290#comment-1305</guid>
		<description>I&#039;ve never seen that problem, but as it happens I&#039;m in Washington, DC at the Stata conference. I&#039;ll ask around and get back to you. Somebody here must have run into this before.</description>
		<content:encoded><![CDATA[<p>I've never seen that problem, but as it happens I'm in Washington, DC at the Stata conference. I'll ask around and get back to you. Somebody here must have run into this before.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrico</title>
		<link>http://enoriver.net/index.php/2008/11/12/data-from-excel-to-stata-take-two/comment-page-1/#comment-1303</link>
		<dc:creator>Enrico</dc:creator>
		<pubDate>Fri, 31 Jul 2009 11:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://enoriver.net/?p=290#comment-1303</guid>
		<description>Hi,
i have seen your routine (which) is great and i am trying to use it for an excel file of 1,357 KB size. It contains quite a few sheets and i think this is the reason why when i run the routine Stata gives me the following error message (after have worked successfully just on one sheet. )

[Microsoft][ODBC Excel Driver] Too many fields defined.

Do you know how to solve this problem? 

Thank you for your help.

Regards
Enrico</description>
		<content:encoded><![CDATA[<p>Hi,<br />
i have seen your routine (which) is great and i am trying to use it for an excel file of 1,357 KB size. It contains quite a few sheets and i think this is the reason why when i run the routine Stata gives me the following error message (after have worked successfully just on one sheet. )</p>
<p>[Microsoft][ODBC Excel Driver] Too many fields defined.</p>
<p>Do you know how to solve this problem? </p>
<p>Thank you for your help.</p>
<p>Regards<br />
Enrico</p>
]]></content:encoded>
	</item>
</channel>
</rss>

