Solution: use the cellrange() option.
This is an informational post. I figured out the answer while typing it out, with the help of William Lisowski's post at at https://www.statalist.org/forums/for...-as-a-csv-file.
I am trying to import an Excel (.xslx) file using the import excel command. With many Excel files, the command runs to completion and works as expected. However, with one specific 73 KB file, the command runs indefinitely (so far I have waited 9 minutes). The little circle loading icon in the bottom right continues to display while I wait. I can open and view the file in Excel.
I have tried running import excel with no options as well as with sheet(). I have tried saving the file in a non-OneDrive directory (usually I work in OneDrive).
When I break (with the red X icon), it looks as though all of my data is loaded (after 9 minutes). Stata has created many variables for the empty columns to the right of my data. Stata has also created many observations (>1M) below the bottom of my data (112 real observations). So the problem seems to be that Stata cannot tell where the data stops.
Version information
StataNow/MP 18.5 for Windows (64-bit)
Revision 16 Jul 2024
This is an informational post. I figured out the answer while typing it out, with the help of William Lisowski's post at at https://www.statalist.org/forums/for...-as-a-csv-file.
I am trying to import an Excel (.xslx) file using the import excel command. With many Excel files, the command runs to completion and works as expected. However, with one specific 73 KB file, the command runs indefinitely (so far I have waited 9 minutes). The little circle loading icon in the bottom right continues to display while I wait. I can open and view the file in Excel.
I have tried running import excel with no options as well as with sheet(). I have tried saving the file in a non-OneDrive directory (usually I work in OneDrive).
When I break (with the red X icon), it looks as though all of my data is loaded (after 9 minutes). Stata has created many variables for the empty columns to the right of my data. Stata has also created many observations (>1M) below the bottom of my data (112 real observations). So the problem seems to be that Stata cannot tell where the data stops.
Version information
StataNow/MP 18.5 for Windows (64-bit)
Revision 16 Jul 2024
Comment