20.01.2021, 11:45 | #5 |
Участник
|
Да. Метод копирует метки для нового листа.
X++: public void copyDefineNames(int _copyFromSheet = 0, int _after = 1, str _suffix = '') { Map buffDefinedNamesMap = Map::create(this.definedNamesMap().pack()); MapEnumerator mapEnumerator = buffDefinedNamesMap.getEnumerator(); container mapKey, mapValue; Bookmark bookmarkOrig; if(_suffix == '') _suffix = strFmt('_%1', _after); while(mapEnumerator.moveNext()) { mapKey = mapEnumerator.currentKey(); bookmarkOrig = conPeek(mapKey, 1); mapKey = conPoke(mapKey, 1, strFmt('%1%2', conPeek(mapKey, 1), _suffix)); mapValue = mapEnumerator.currentValue(); mapValue = conPoke(mapValue, 1, workbook.worksheets().lookup(_after).name()); this.definedNamesMap().insert(mapKey, mapValue); } } |
|