I find it difficult to reproduce your problem, but below is a working example using various case() options (basically from help import excel):
clear all
set more off
*----------------- Create data -----------------------------
* Load example Stata data base
sysuse auto
keep make price headroom length turn
* Change variable names to experiment
rename (headroom length turn) (HEADRoom LENGTH turN)
* Create example Excel file
export excel auto, firstrow(variables) replace
*----------------- Importing -------------------------------
* Import just as it is
import excel auto.xls, firstrow clear
describe
* Import with upper case
import excel auto.xls, firstrow case(upper) clear
describe
* Import with lower case
import excel auto.xls, firstrow case(lower) clear
describe
Note they all work fine. Variable names are converted to upper/lower case accordingly. Variable labels are not, but this is expected. From help import excel we have:
The original names in the first row are stored unmodified as variable
labels.
and case() only affects variable names.
You also mention:
The import command works fine when I don't use the case() option.
Suppose this is true. Then to convert variable names to lower case after the import, you can try
rename _all, lower
See help rename group for details. (But like I showed, the case() option works.)
Finally, if it is the variable labels you are after, you can change them using something like
foreach varr of varlist _all {
label variable `varr' "`varr'"
}
That just copies the variable name to the label, for all variables. So running that after all your variable names are converted to lower case, would give you variable labels that are also lower case. Run help label for details.