Skip to content

Runtime error 9 in Serialize() function #16

Closed

Description

@MarioAnthes

Hi Cristian, by coincidence I've found a bug in your VBA-FastJSON library.

Import LibJSON.bas and Dictionary.cls (your FastDictionary class) into an empty VBA project.

Execute
?LibJSON.Serialize(Array(New Dictionary, Array(1)))
in the VBE immediate window.

Instead of the expected result "[{},[1]]" a runtime error 9 occurs accessing vars.vt(0) in line
Dim vt As VbVarType: vt = vars.vt(0) And &H3FFF& 'Remove VT_BYREF

The following doesn't raise an error:
?LibJSON.Serialize(Array(New Dictionary, 1))

Also the following works as expected:
?LibJSON.Serialize(Array(New Collection, Array(1)))

Any ideas?

Activity

  1. added a commit that references this issue on Oct 22, 2026
  2. cristianbuse commented on Oct 22, 2026

    @cristianbuse
    Owner

    Thank you @MarioAnthes

    This has been fixed in latest release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions