Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: ODBC with Excel

From   "Rodrigo A. Alfaro" <>
To   <>
Subject   st: Re: ODBC with Excel
Date   Thu, 24 May 2007 17:53:01 -0400

Thomas wrote:
I am attempting to automate a routine where a series of Excel
spreadsheets are downloaded from the internet via Stata and saved in a
local directory for later analysis.

The files are correctly saved and can be opened in MS Excel 2007.
Did you mean something like this:
copy c:\data\xls\d101.xls?

I don't have problem with this sentence, it should work.


----- Original Message ----- From: "Thomas Speidel" <>
To: <>
Sent: Thursday, May 24, 2007 12:46 PM
Subject: st: ODBC with Excel

However, a warning message in Excel indicates the following: "File
error. Some number formats may have been lost." Once I dismiss the error
message, the file is correct, including the formats.

When I try to load the Excel file in Stata using .odbc load, I get the
following error (debug on):
[Microsoft][ODBC Excel Driver] Reserved error (-5016); there is no
message for this error.
[Microsoft][ODBC Excel Driver] Reserved error (-5016); there is no
message for this error., SQLSTATE=HY000

-Interestingly, if, once I dismiss the error in Excel 2007, I save the
document and try to load it in Stata, it loads fine without any errors.
-Changing the odbc driver used when setting up the data source in
Windows to an earlier one, does not resolve the problem.
-Because this is part of an automation routine, manually opening each
Excel document in order to dismiss the error and hitting save, is not a
sensical option.
-Windows XP home, Microsoft Office 2007

I know this question has much more to do to MS Excel than Stata, but I
am wondering if anyone has encountered this problem or if anyone has a
suggestion or alternate solutions.

Thank you,
Thomas Speidel
*   For searches and help try:
*   For searches and help try:

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