Try to set some number with 4 digits and more in hexa code, it returns bad decimal number. Example with macro: Sub bugHexaNumber msgbox CLng("&hF000") '61440 OK msgbox &hF000 '-4096 BUG End Sub OK: Verze: 6.3.0.1 (x64) ID sestavení: 41ac97386aba908b6db860cfb4cfe2da871886ae Vlákna CPU: 2; OS: Windows 6.1; Vykreslování UI: výchozí; VCL: win; Národní prostředí: cs-CZ (cs_CZ); UI-Language: cs-CZ Calc: CL BUG: Version: 7.0.0.1 (x64) Build ID: 04ba7e3f1e51af6c5d653e543a620e36719083fd Vlákna CPU: 2; OS: Windows 6.1 Service Pack 1 Build 7601; Vykreslování UI: Skia/rastr; VCL: win Locale: cs-CZ (cs_CZ); UI: cs-CZ Calc: CL Version: 7.4.2.1 (x64) / LibreOffice Community Build ID: 681d65acd9ede00dd724d6716f21cabfdcc95bd2 CPU threads: 8; OS: Windows 10.0 Build 17763; UI render: Skia/Raster; VCL: win Locale: cs-CZ (cs_CZ); UI: cs-CZ Calc: CL
Not a bug. In msgbox &hF000 the &hF000 is a 16-bit (short) integer constant where the leading high bit is a sign bit and indicates a twos complement negative number. This was fixed in 6.4.0 for bug 62326. Force a 32-bit (long) constant with &hF000&