2

I am a complete beginner and trying to use JSON with VBA. This is to pass data from outside excel into the application so I can apply VBA.

The JSON file can look complicated and so to help I was wondering if comments can be added?

Andy
  • 919
  • 2
  • 9
  • 22

3 Answers3

2

JSON does not support comments.

Anything that you put in the JSON object will be treated as data

Andy
  • 919
  • 2
  • 9
  • 22
1

You can't directly add comments, but you could just create new keys, where you put in your comments:

{
key1: value1,
key1_comment: "This is a comment for key1"
}
0

There is so-called HJSON (Human JSON) which can have comments and other human-friendly features. And it has support in many popular languages.

See also this question at StackOverflow regarding comments in JSON.

Arty
  • 14,883
  • 6
  • 36
  • 69