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.
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:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/