While executing my code I have encountered an occasion when the following message was produced in the output with execution aborted:

There were two different lines of code that could have been executed at the time:
1.
or
2.
both of which output some well-formed text to the Excel file being staged. Macros:
* i is the counter of lines, and due to amount of output can get into thousands, but otherwise nothing special about it.
* lev is 2012 in this case.
* allcomments is in general some text, but should be empty for the specific loop iteration here.
The error only occurred once, and didn't reoccur when the same code was re-run (hence I couldn't debug it to see which line of code failed and for which values.)
After searching the internet I didn't find a single mentioning of the exact message "could not write italic() format to file" , but the closest relevant result was the message from Sarah Eliason here, which cited "could not write merge format to file" under some circumstances.
I am seeking any guidance (in Stata's documentation or in 3-rd party resources) on the conditions that may provoke this specific error, as well as hopefully any explanation as to why it may occur only some times, and not being reproducible.
Thank you, Sergiy
Version information: Stata 17.0(170130) on Windows.
There were two different lines of code that could have been executed at the time:
1.
Code:
putexcel B`i' = `"`allcomments'"' , italic
2.
Code:
putexcel B`i' = "`lev'", fpattern(solid, "238 236 225") font("Calibri", 14) bold italic
* i is the counter of lines, and due to amount of output can get into thousands, but otherwise nothing special about it.
* lev is 2012 in this case.
* allcomments is in general some text, but should be empty for the specific loop iteration here.
The error only occurred once, and didn't reoccur when the same code was re-run (hence I couldn't debug it to see which line of code failed and for which values.)
After searching the internet I didn't find a single mentioning of the exact message "could not write italic() format to file" , but the closest relevant result was the message from Sarah Eliason here, which cited "could not write merge format to file" under some circumstances.
I am seeking any guidance (in Stata's documentation or in 3-rd party resources) on the conditions that may provoke this specific error, as well as hopefully any explanation as to why it may occur only some times, and not being reproducible.
Thank you, Sergiy
Version information: Stata 17.0(170130) on Windows.
Comment