Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Mismatch when parsing received JSON #17

Closed
michaleibl opened this issue Feb 6, 2014 · 5 comments · Fixed by #18
Closed

Type Mismatch when parsing received JSON #17

michaleibl opened this issue Feb 6, 2014 · 5 comments · Fixed by #18

Comments

@michaleibl
Copy link

The received JSON contained "Amount":14.6000000000, which was correctly parsed and given to CDbl for conversion. But it threw the mentioned error. I see a problem in usage of CDbl for converting the string to double because it's locale-dependent (my locale has ',' as decimal separator, which is of course nonsence to use in JSON). Using the Val for conversion solves this issue.

@timhall
Copy link
Member

timhall commented Feb 6, 2014

Hi @michaleibl I've updated RestHelpers to use Val for parsing numbers. Will you give it a try and see if it fixes your issue?

You can find it here: https://raw2.github.com/timhall/Excel-REST/parse-numbers/src/RestHelpers.bas

@michaleibl
Copy link
Author

Hey @timhall, I fixed it the same way and it worked fine.

@timhall
Copy link
Member

timhall commented Feb 6, 2014

Cool, thanks for raising this issue

@michaleibl
Copy link
Author

No problem. Thanks for working on this project ;)

2014-02-06 Tim Hall notifications@github.com:

Cool, thanks for raising this issue


Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-34349753
.

@jiliff
Copy link

jiliff commented Mar 2, 2017

Hello, I am using GitHub's VBA-JSON parsing tool (jsonconverter.bas) to parse a Json file.

When I try to capture the value of one of the elements in the Json file through this line I get a mismatch error.

MsgBox Json("ProvderContractAPI")("provContractHeader")("provContract")("recoveryDeadlinePeriod")

I'm expecting to receive the value of recoveryDeadlinePeriod which is nested in the former elements.

Thoughts?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants