Excel API login issue is solved

5 posts / 0 new
Last post
koub
Excel API login issue is solved

Hi guys, I’m new on this forum, jus subscribe to give you the solution for the problem of login

“Runtime error '1004', unable to get the RTD property of the WorksheetFunction class”

In debug mode, VBA code crash on this line in the streamingAuthentication function:
“result = Application.WorksheetFunction.RTD(IG_API_RTD_PROC_ID, "", "connect", m_lsHost, m_currentAccountId, password, maxPriceUpdateFrequency)”

If you check all parameters and read the complete code, the problem doesn’t come from an Excel 32bits or 64bits version or Windows OS.

“m_lsHost” and “m_currentAccountId” variables are empty, so the RTD command crash…

Problems come from the integrated VB JSON module (JSON.bas) because this code parse numbers included in the OXMLHTTP.ResponseText with a hard-coded point “.”.

If the decimal separator of your Windows OS regional settings is a comma “,”, the JSON parse number function crash and can’t extract needed data.

To solve the problem, you can:

- change the comma with a point in the windows regional setting (advanced setting, decimal separator)

- modify the JSON.bas module (I think, it’s the better way):

1. Add this function at the end of the module:
Function DecimalSep() As String
DecimalSep = Mid$(1 / 2, 2, 1)
End Function

2. In the parseNumber function, replace the line:
parseNumber = CDec(Value)
by
parseNumber = CDec(Replace(value, ".", DecimalSep()))

Kind regards and special dedicated to my friends of ANDLIL community.

Koub37 ^^

falex
Oh what a pitty what a shame.

Oh what a pitty what a shame.

This seems to be the same problem has the iphoe IG Application.
When your regional setting are set with a coma, you need to erase the "." and to type de coma ...
Very noising for all "coma"-decimal people.

falex
juste a picture to give you

juste a picture to give you an idea of how much people use Coma "virgule" in french :
http://fr.wikipedia.org/wiki/S%C3%A9parateur_d%C3%A9cimal#mediaviewer/Fi...

So please IG do your best to repari that asap and to mind that the majority of people use coma and not "point" !

Chris
Re: Excel API login issue is solved

Hi koub

Thanks very much for sharing this! We're in the process of testing this fix ourselves, so will post here once we have our results.

Chris

koub
Hi Chris, you are welcome, if

Hi Chris, you are welcome, if that can help the community...

Regards, koub. :)

Log in or register to post comments