{"action":"created","issue":{"url":"https://api.github.com/repos/diadoc/diadocapi-docs/issues/48","repository_url":"https://api.github.com/repos/diadoc/diadocapi-docs","labels_url":"https://api.github.com/repos/diadoc/diadocapi-docs/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/diadoc/diadocapi-docs/issues/48/comments","events_url":"https://api.github.com/repos/diadoc/diadocapi-docs/issues/48/events","html_url":"https://github.com/diadoc/diadocapi-docs/issues/48","id":170375082,"number":48,"title":"VBA. Вопрос по использованию функций GetCounteragents/GetDocuments","user":{"login":"enatdne","id":20945962,"avatar_url":"https://avatars.githubusercontent.com/u/20945962?v=3","gravatar_id":"","url":"https://api.github.com/users/enatdne","html_url":"https://github.com/enatdne","followers_url":"https://api.github.com/users/enatdne/followers","following_url":"https://api.github.com/users/enatdne/following{/other_user}","gists_url":"https://api.github.com/users/enatdne/gists{/gist_id}","starred_url":"https://api.github.com/users/enatdne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enatdne/subscriptions","organizations_url":"https://api.github.com/users/enatdne/orgs","repos_url":"https://api.github.com/users/enatdne/repos","events_url":"https://api.github.com/users/enatdne/events{/privacy}","received_events_url":"https://api.github.com/users/enatdne/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/diadoc/diadocapi-docs/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-10T09:43:09Z","updated_at":"2016-08-15T09:34:00Z","closed_at":null,"body":"1.\tПытаюсь воспользоваться функцией GetDocumetns в VBA. \r\n    token = diadoc.AuthenticateWithPassword(login, Password)\r\n    Boxid = \"bdc1e5e9b0964c8dbc02958b2d9ec379@diadoc.ru\"\r\n    Set DocumentList = diadoc.GetDocuments(token, Boxid, AnyInvoiceDocumentType.InboundFinished, \"\", \"01.01.2016\", \"01.08.2016\", \"\", \"\", \"\", \"\", \"\")\r\n\r\nВыдает ошибку:\r\n \"Run-time\" error '424': Object required\r\n\r\nПодскажите, пожалуйста, чего не хватает?\r\n\r\n2.\tТакже непонятно как получить данные из массива CounterAgents метода GetCounteragents\r\n     Set CounteragentList = diadoc.GetCounteragents(token, Boxid, Null, Null)\r\n    \r\n             For s = 0 To CounteragentList.TotalCount  работает\r\n             s_id = CounteragentList.TotalCount  работает, возвращает кол-во\r\n             IndexKey = CounteragentList.Counteragents.Item(s).IndexKey  не работает, выдает ошибку (см. Ниже) \r\n             Worksheets(\"Sheet3\").Cells(i, 1).Value = s_id\r\n             Worksheets(\"Sheet3\").Cells(i, 2).Value = IndexKey\r\n             s = s + 1\r\n             Next s\r\n     Worksheets(\"Sheet3\").Activate\r\n \r\nВыдает ошибку :  \"Run-time\" error '438': Object doesn't support this property or method\r\n\r\nПросьба пояснить как получить досуп к массиву CounterAgents. \r\n\r\n      \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/diadoc/diadocapi-docs/issues/comments/239763806","html_url":"https://github.com/diadoc/diadocapi-docs/issues/48#issuecomment-239763806","issue_url":"https://api.github.com/repos/diadoc/diadocapi-docs/issues/48","id":239763806,"user":{"login":"enatdne","id":20945962,"avatar_url":"https://avatars.githubusercontent.com/u/20945962?v=3","gravatar_id":"","url":"https://api.github.com/users/enatdne","html_url":"https://github.com/enatdne","followers_url":"https://api.github.com/users/enatdne/followers","following_url":"https://api.github.com/users/enatdne/following{/other_user}","gists_url":"https://api.github.com/users/enatdne/gists{/gist_id}","starred_url":"https://api.github.com/users/enatdne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enatdne/subscriptions","organizations_url":"https://api.github.com/users/enatdne/orgs","repos_url":"https://api.github.com/users/enatdne/repos","events_url":"https://api.github.com/users/enatdne/events{/privacy}","received_events_url":"https://api.github.com/users/enatdne/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T09:34:00Z","updated_at":"2016-08-15T09:34:00Z","body":"По поводу CounterAgents: \" Поля  Counteragents  в COM-объекте  ICounteragentList  нет, есть  CounteragentsList , то есть в данном случае должно быть  CounteragentsList.CounteragentsList.Item(s).IndexKey  \" -->\r\n\r\nSub API_test()\r\n\r\n    Dim Key, login, Password, CountINN\r\n    \r\n    Key = Worksheets(\"Sheet1\").Cells(1, 3).Value 'êëþ÷ ðàçðàáîò÷èêà\r\n    login = Worksheets(\"Sheet1\").Cells(2, 3).Value\r\n    Password = Worksheets(\"Sheet1\").Cells(3, 3).Value\r\n    CountINN = Worksheets(\"Sheet1\").Cells(4, 3).Value\r\n    \r\n    Dim i, diadoc, filter, token\r\n    i = 2\r\n    Set diadoc = CreateObject(\"Diadoc.Api.ComDiadocApi2\")\r\n    diadoc.Initialize Key, \"https://diadoc-api.kontur.ru\"\r\n    token = diadoc.AuthenticateWithPassword(login, Password)\r\n    \r\n '---------------------------------------------------------------\r\n    \r\n    'Ñîçäàåì îáúåêò DocumentsTask, çàïîëíÿåì ñâîéñòâà, âûïîëíÿåì ìåòîä è ïîëó÷àåì ñïèñîê äîêóìåíòîâ\r\n    Dim Organization, Boxid, DocumentsTask, DocumentList, Document\r\n     \r\n    Boxid = \"368f119e-22c1-4124-8efa-c6cfffa06002\"\r\n    Set Organization = diadoc.GetOrganizationById(Boxid)\r\n         \r\n    Dim inn_s, kpp_s, CounteragentList, s, s_id, IndexKey\r\n    \r\n    'Ïîëó÷àåì ñïèñîê êîíòðàãåíòîâ ñ çàäàííûìè ÈÍÍ/ÊÏÏ\r\n    Set CounteragentList = diadoc.GetCounteragents(token, Boxid, Null, Null)\r\n    \r\n           For s = 0 To CounteragentList.TotalCount\r\n             s_id = CounteragentList.TotalCount\r\n             IndexKey = CounteragentsList.CounteragentsList.Item(s).IndexKey\r\n             Worksheets(\"Sheet3\").Cells(i, 1).Value = s_id\r\n             Worksheets(\"Sheet3\").Cells(i, 2).Value = IndexKey\r\n            s = s + 1\r\n            Next s\r\n            Worksheets(\"Sheet3\").Activate\r\n\r\nEnd Sub\r\n\r\nОшибка:\r\nОшибка:\r\nRun-time error '424':\r\n Object required "}}
{"actor":{"display_login":"enatdne"}}