Hi all, I'm new to posting on Statalist but have gleaned from your collective knowledge and cordial wisdom for a few years. I am also versed in how to pronounce and write Stata 
I have a problem for which I have not, even eventually, been able to work out. I want to export to the same excel workbook, in the same sheet using two different export commands, tabout and putexcel. I know that putexcel is precise in it's placement of data, meaning you have to tell putexcel precisely where to put data, so I always begin with putexcel. Then, I try to append a table from tabout to the same worksheet, but it does not append. I get no error. The putexcel command executes as expected, but the tabout results are not exported to excel. In my reading of tabout help files, I thought that it figures out where to put appended tables based on what's already there, so I thought this would work.
I have 4033 observations on a terminal server using Stata 15.1, so I unfortunately can't use the stataex command. 'enr_cats' and 'year' are both numeric. Here is a replication of my code: (I'm using courier new font so it looks more familiar to Stata eyes)
putexcel set "$output\enrollment3_table.xls", replace
putexcel A1=""
putexcel close
tabout enr_cats year using "$output\enrollment3_table.xls", c(freq) f(0) append clab(No._Schools)
tabout enr_cats year using "$output\enrollment3_table.xls", c(col) f(2) append clab(%_Schools)
I've tried with and without the 'putexcel close' command and get the same result. No export of tabout to excel and no error.
Any ideas? Is what I'm asking not possible?
Many thanks for years of help and possible new help,
Becca

I have a problem for which I have not, even eventually, been able to work out. I want to export to the same excel workbook, in the same sheet using two different export commands, tabout and putexcel. I know that putexcel is precise in it's placement of data, meaning you have to tell putexcel precisely where to put data, so I always begin with putexcel. Then, I try to append a table from tabout to the same worksheet, but it does not append. I get no error. The putexcel command executes as expected, but the tabout results are not exported to excel. In my reading of tabout help files, I thought that it figures out where to put appended tables based on what's already there, so I thought this would work.
I have 4033 observations on a terminal server using Stata 15.1, so I unfortunately can't use the stataex command. 'enr_cats' and 'year' are both numeric. Here is a replication of my code: (I'm using courier new font so it looks more familiar to Stata eyes)
putexcel set "$output\enrollment3_table.xls", replace
putexcel A1=""
putexcel close
tabout enr_cats year using "$output\enrollment3_table.xls", c(freq) f(0) append clab(No._Schools)
tabout enr_cats year using "$output\enrollment3_table.xls", c(col) f(2) append clab(%_Schools)
I've tried with and without the 'putexcel close' command and get the same result. No export of tabout to excel and no error.
Any ideas? Is what I'm asking not possible?
Many thanks for years of help and possible new help,
Becca
Comment