Build 4.9.0.1 of xlsgen makes it possible to retarget the scope of a defined name. Particularly make it local to a sheet. To that end, the Local property of existing named ranges can be set accordingly as in :
// let's say we have two sheets, Sheet1 and Sheet2
// also let's say range2 = Sheet2!R2C2:R20C5, and of global scope
workbook->WorksheetByName[L"Sheet1"]->DynamicRange[L"range2"]->Local = TRUE; // tell range2 to be local to Sheet2