Dear Stata users,
I am using StataMP 14.1. I am having a problem reading data in .xlsx format. Here are the codes that I used:
After I run the code, I got the following warning: “file D:\FirmInfoAffiliation12.15.xlsx could not be loaded
r(603);”
I also tried to read the data manually: File-> Import -> Excel Spreadsheet. I got the following warning message.

The same data can be read on my college’s PC, so the data should have no problem. Or it could be that the data have some problems but my college's PC managed to solve the problem and read the data.
All of these happened very suddenly. I did not update the Stata package. And I did not update excel as well. I tried to read other data in .xls format and Stata works well.
Attached are two samples of my data which is confidential so I can only show you a sample. Book2.xlsx Book1.xlsx
Both samples have two rows and 39 variables. The first row contains variable names, and the second row contains the data. What's more confusing is that the first sample, Book1.xlsx can be read while the second sample Book2.xlsx which contains exactly same data as Book1 cannot.
I googled and found some similar questions. The only solution that works for me is to save as .xls, but I have quite a lot of data in xlsx format. And the data size is limited if I use .xls.
Anyone suggestions are welcomed. Thank you very much.
I am using StataMP 14.1. I am having a problem reading data in .xlsx format. Here are the codes that I used:
Code:
clear
import excel "D:\FirmInfoAffiliation12.15.xlsx", sheet("FullList") firstrow
r(603);”
I also tried to read the data manually: File-> Import -> Excel Spreadsheet. I got the following warning message.
The same data can be read on my college’s PC, so the data should have no problem. Or it could be that the data have some problems but my college's PC managed to solve the problem and read the data.
All of these happened very suddenly. I did not update the Stata package. And I did not update excel as well. I tried to read other data in .xls format and Stata works well.
Attached are two samples of my data which is confidential so I can only show you a sample. Book2.xlsx Book1.xlsx
Both samples have two rows and 39 variables. The first row contains variable names, and the second row contains the data. What's more confusing is that the first sample, Book1.xlsx can be read while the second sample Book2.xlsx which contains exactly same data as Book1 cannot.
I googled and found some similar questions. The only solution that works for me is to save as .xls, but I have quite a lot of data in xlsx format. And the data size is limited if I use .xls.
Anyone suggestions are welcomed. Thank you very much.

Comment