Hello all,
I was working on a do file to generate my -dtables- and adding the putdocx statements to export two tables out. The code below is the final putdocx statements and save statement. I am getting a very persistent r(110) error indicating document is already open. The docx file never saved. I have tried several variations of clearing memory, putdocx and collect including clear, -exit, clear-, -collect clear-.Even tried exiting the session and coming back. But it still persists.
What else can I do? I do have a header script (listed below the first code block) for initializing folders for the project (that Clyde Schechter had recommended) which works wonderfully in all the other files. If there is anything else you need to troubleshoot, I am glad to share. Tried looking at other topic on this forum but could not find the right solution.
Error portion:
Initialization code:
I was working on a do file to generate my -dtables- and adding the putdocx statements to export two tables out. The code below is the final putdocx statements and save statement. I am getting a very persistent r(110) error indicating document is already open. The docx file never saved. I have tried several variations of clearing memory, putdocx and collect including clear, -exit, clear-, -collect clear-.Even tried exiting the session and coming back. But it still persists.
What else can I do? I do have a header script (listed below the first code block) for initializing folders for the project (that Clyde Schechter had recommended) which works wonderfully in all the other files. If there is anything else you need to troubleshoot, I am glad to share. Tried looking at other topic on this forum but could not find the right solution.
Code:
// Final layout & export *----------------------- collect layout (vargrp#var var[`binvars']) (icc2#result#_dtable_sample_dim) collect preview putdocx begin collect style putdocx, layout(autofitcontents) /// title("Table 1: Cohort characteristics by TP53 allelic state.") collect export "`prfold'/outputs/table1_demo.docx", replace
Code:
. collect style putdocx, layout(autofitcontents) /// > title("Table 1: Cohort characteristics by TP53 allelic state.") . . collect export "`prfold'/outputs/table1_demo.docx", replace document already open in memory r(110);
Code:
local prfolder Prj_akp53 include DIRECTORY_INITIALIZATION.DOH, adopath **************************************************************************************************** *Title: Spectrum of TP53-mutated myeloid leukemia: A single institution cohort across 8 years **************************************************************************************************** // Program: p53_tables.do // Task : Uses an01-merged.dta // Outputs: Tables for first submission // Project: TP53 mutations in myeloid neoplasms and outcome // Author : GV \date: 2023-10-12 use "`prfold'/dtafiles//an01-merged.dta", replace qui do "`prdo'//p53select.doh" qui include "`pwork'//unicoder.do" // Need for Superscript units collect clear putdocx clear
Comment