Dear all,
I have used "collect export" for the first time to save tables in an Excel file after the "table" command.
On the first run, when a new Excel file is created, everything always works fine. But the very next time, it doesn't work anymore.
When I then want to open the Excel file, I get the message "We found a problem with some content in 'File.xlsx'. Do you want us to try to recover as much as we can?" When I click on "Yes", I get "'File.xlsx' is locked for editing".
The problem does not exist with one-way tables, e.g.
table var1 , statistic(median var2)
collect export File.xlsx, sheet(Data) as(xlsx) cell(A1) open modify
In this case, I can run the Do-File as often as I want without any problems.
With two-way tables, however, it is different, e,g,
table var1 var3, statistic(median var2)
collect export File.xlsx, sheet(Data) as(xlsx) cell(A1) open modify
Then the error messages mentioned above appear. Apparently there is a problem when Stata writes the variable name of var3 into the Excel file and connects cells in the process.
Is this problem known and, if so, is there a solution to fix it?
Many thanks in advance.
Georg
I have used "collect export" for the first time to save tables in an Excel file after the "table" command.
On the first run, when a new Excel file is created, everything always works fine. But the very next time, it doesn't work anymore.
When I then want to open the Excel file, I get the message "We found a problem with some content in 'File.xlsx'. Do you want us to try to recover as much as we can?" When I click on "Yes", I get "'File.xlsx' is locked for editing".
The problem does not exist with one-way tables, e.g.
table var1 , statistic(median var2)
collect export File.xlsx, sheet(Data) as(xlsx) cell(A1) open modify
In this case, I can run the Do-File as often as I want without any problems.
With two-way tables, however, it is different, e,g,
table var1 var3, statistic(median var2)
collect export File.xlsx, sheet(Data) as(xlsx) cell(A1) open modify
Then the error messages mentioned above appear. Apparently there is a problem when Stata writes the variable name of var3 into the Excel file and connects cells in the process.
Is this problem known and, if so, is there a solution to fix it?
Many thanks in advance.
Georg
Comment