API Support Forum
OEC API > API Support > Problem with API COM Excel
Author Topic: Problem with API COM Excel
(11 messages, Page 1 of 1)
Moderators: VPfau
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 10, 2008 @ 03:58 PM             Msg. 1 of 11
When I login Excel return err-message "Invalid property array index" because in
Public Sub PrepareContracts()
cmbContracts.Clear
Dim ContractList As OECAPICOM.ContractList
Set ContractList = api.Contracts
For i = 0 To ContractList.Count - 1
cmbContracts.AddItem ContractList.ItemByIndex(i).symbol
Next
cmbContracts.value = cmbContracts.List(0)
End Sub

on sheet "Abbreviated"
ContractList.Count = 0
Why ContractList.Count = 0 ?
My login TFaser62
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 10, 2008 @ 04:02 PM             Msg. 2 of 11
as we recently announced, latest version of OEC API does not download all available contracts on login.

You have to manually download contracts for symbols (BaseContracts) you are interested in, using OECClient.RequestContracts method, and you need to subscribe the OnContractsChanged event to know when contracts are downloaded.

The Excel sample will be updated today for this change.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 10, 2008 @ 04:10 PM             Msg. 3 of 11
Thanks,
pls write here or to my mail mikleog6@gmail.com
when update Excel-sample and
how I can get new Excel-file
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 11, 2008 @ 10:50 AM             Msg. 4 of 11
Please download and install latest "API COM Interface" from the My Account/API Documentation page of this web site.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 11, 2008 @ 01:44 PM             Msg. 5 of 11
Excel send err-messages:
1. "Application defined or object defined error"
and after click "Ok" next err-message
2."Login Failed: InvalidUserOrPassword"

What problem is?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 11, 2008 @ 01:53 PM             Msg. 6 of 11
Please make sure you are using valid username and password. You can check it using OEC Trader Dev.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 11, 2008 @ 02:06 PM             Msg. 7 of 11
FIRST err-messages:
1. "Application defined or object defined error"

Why?
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 11, 2008 @ 02:26 PM             Msg. 8 of 11
I input log\pass TFaser62\Demo11654 - it's valid, because it work in OECTrader
Repeat it many time.
Why it log\pass not valid in API COM Excel?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 11, 2008 @ 02:35 PM             Msg. 9 of 11
This username and password are for demo environment. API developers are working with API environment, which has different username and password.

Regarding Application defined error - I do not quite see how did you get that.
You could enable break on all errors mode in the excel debugger and check where in the source code it happens - this could give a clue.
DMu72
Posts: 20
Joined: May 28, 2008


Posted: Jun 11, 2008 @ 03:37 PM             Msg. 10 of 11
If I right undetrstand Y,
my Api Devrlop login is DMu72.
But I forgot password for it login.
In mail-box(mikleog5@gmail.com) for DMu72 login
not have message from OEC's server with passsword for the login.
How I can remember password or inquire it?
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Jun 12, 2008 @ 08:25 AM             Msg. 11 of 11
since it doesn't seem to be related to API programming, I've forwarded your request to our general support - support@openecry.com.