Hi,

I am trying to import an Excel spreadsheet the usual way but I am getting an error:
Code:
. import excel "0.Equity_Datastream.xlsx", clear firstrow sheet("Data_Query") cellrange(A7)
no room to add more variables
    Up to 5,000 variables are currently allowed, although you could reset the maximum using set maxvar; see help memory.
no room to add more variables
    Up to 5,000 variables are currently allowed, although you could reset the maximum using set maxvar; see help memory.
r(900);
The dataset I am trying to import has much less than 5,000 variables so I am no seeking to "set maxvar" to a bigger number. It turns out that Stata does not seem to be able to recognize the size of the Excel spreadsheet since it loads empty cells infinitely after the last variable. I enclose a screenshot.

Note that the number of variables changes as I am updating the spreadsheet so I do not want to write down a fixed "cellrange". Please let me know if there is a way to fix thi Array s. Thanks.