Hello!
First time poster. I read the Advice on Posting, have looked through Stata manuals, and looked for previous posts and other sites covering this issue. I have not found any materials related to this issue. Apologies if I missed a convention, protocol, or best practice in this post.
I am running Stata 17 MP. Using putexcel set and specifying the options sheet("Name", replace) modify, if I place an image file into a cell and place a second image in the same worksheet and file, the images stack on top of each other in Excel. The worksheet is not being replaced. Rather, the worksheet is being modified and added to.
This produces a workbook named "test.xlsx" with one worksheet named "Test". The "Test" worksheet contains two images stacked on top of each other (i.e., clicking and dragging one image reveals a second image) as well as the text "Test" in cell A1. To me, this suggests that the sheet("Test", replace) modify options are not working as intended. However, I want to check with the community here and see if this is a known issue, if my understanding of the putexcel set options sheet("Name", replace) modify is wrong, if my code or syntax are incorrect, or if this is an issue specific to me. I can replicate this issue on other machines in my organization.
Any help would be appreciated, and I am happy to provide more information if necessary. Thanks!
First time poster. I read the Advice on Posting, have looked through Stata manuals, and looked for previous posts and other sites covering this issue. I have not found any materials related to this issue. Apologies if I missed a convention, protocol, or best practice in this post.
I am running Stata 17 MP. Using putexcel set and specifying the options sheet("Name", replace) modify, if I place an image file into a cell and place a second image in the same worksheet and file, the images stack on top of each other in Excel. The worksheet is not being replaced. Rather, the worksheet is being modified and added to.
Code:
sysuse auto, clear twoway scatter price mpg graph export ".\test.png", as(png) replace graph close putexcel set ".\test.xlsx", sheet("Test", replace) modify putexcel A1 = image(".\test.png") putexcel save putexcel close erase ".\test.png" twoway scatter price mpg graph export ".\test2.png", as(png) replace graph close putexcel set ".\test.xlsx", sheet("Test", replace) modify putexcel A1 = image(".\test2.png") putexcel save putexcel close erase ".\test2.png" putexcel set ".\test.xlsx", sheet("Test", replace) modify putexcel A1 = "Test" putexcel save putexcel close
Any help would be appreciated, and I am happy to provide more information if necessary. Thanks!
Comment