function TXLSNames.Add bug
Posted: Thu Feb 16, 2017 7:18 am
hi.
Here is function text
Problem occurs if ASheetName has special symbol i.e. "one-two"
Tokenizer breaks sheet name on this symbol and can not find sheet with name "one".
Quoting sheet name is not an option because does not check quotes and can not find sheet with quoted name.
i suggest to fix function in this way:
regards
Anton
Here is function text
Code: Select all
function TXLSNames.Add(const AName, ASheetName: AxUCString; const ACol, ARow: integer): TXLSName;
var
Def: AxUCString;
begin
if FManager.Worksheets.Find(ASheetName) < 0 then begin
FManager.Errors.Error(ASheetName,XLSERR_FMLA_UNKNOWNSHEET);
Result := Nil;
end
else begin
Def := ASheetName+ '!' + ColRowToRefStr(ACol,ARow,True,True);
Result := Add(AName,Def);
end;
end;
Tokenizer breaks sheet name on this symbol and can not find sheet with name "one".
Quoting sheet name is not an option because
Code: Select all
FManager.Worksheets.Find(ASheetName)
i suggest to fix function in this way:
Code: Select all
Def := QuotedStr(ASheetName)+ '!' + ColRowToRefStr(ACol,ARow,True,True);
Anton