This thread
http://www.statalist.org/forums/foru...le#post1332948
is somewhat relevant, but code like this
doesn't actually export the variable, despite what that thread says. It only exports the first observation. I could loop through each observation and export it, but surely there is an easier way to do this with putexcel, and looping through each observation means I have _N writes to the file, which is quite slow.
Also, export excel is not an option in this case because I'm writing out variables of different data types from various datasets into the same sheet, and export excel doesn't allow for that level of fine-grained control.
putexcel does allow for this level of control, unless there isn't a way to write the entire contents of a string variable (or even numeric variable) without jumping through a lot of hoops.
http://www.statalist.org/forums/foru...le#post1332948
is somewhat relevant, but code like this
Code:
putexcel set "results.xlsx", sheet("out") replace sysuse auto, clear putexcel A2 = make
Also, export excel is not an option in this case because I'm writing out variables of different data types from various datasets into the same sheet, and export excel doesn't allow for that level of fine-grained control.
putexcel does allow for this level of control, unless there isn't a way to write the entire contents of a string variable (or even numeric variable) without jumping through a lot of hoops.
Comment