Code:
local a "week"
local b "year"
putexcel set test, sheet(foo, replace) replace 
// works OK if I leave off the first replace above
*putexcel set test, sheet(foo) replace 
// this works too
*putexcel set test, sheet(foo, replace) modify
putexcel a1 = ("`a'")   // only b1 shows up in excel
putexcel b1 = ("`b'")
*putexcel a1 = "foo"    // works OK if I use strings directly
*putexcel b1 = "bar"Problem seems to happen only if:
* I use the replace option twice, for both the workbook and worksheet
* try to output multiple cells using local macros
This is not much of a problem for me going forward because upon further reflection I think the double replace specification here is probably redundant and it makes more sense to either:
* replace the workbook (which seems to imply replacing the sheet also?)
* modify the workbook and replace the worksheet
And both those ways seem to work fine. But this really confused me for a couple of hours as I sorted out what was causing the problem so I figured it was worth a post.
0 Response to putexcel problem with double replace and local macros
Post a Comment