2017-09-09 15 views
2

この問題を解決できますか? コンパイルエラー:ユーザー定義型定義されていないのエラーメッセージが表示されてDimとしてのDim。コンパイルエラー:ユーザー定義の型が定義されていません

Dim authResult As Dictionary 

:私はこのマクロを実行するたびに 、それはで停止します。

私は前に辞書型を使用していませんでした。このマクロをサンプルマクロから再利用しようとしています。

このスクリプトの目的は、履歴データをダウンロードできるようにexcelを使用してウェブサイトに電話をかけることです。私は現在、ログインセクションで立ち往生しています。

Sub Login() 

    Dim userName As String 
    Dim password As String 
    Dim apiKey As String 

    userName = "username" 
    password = "password" 
    apiKey = "key123" 

    'activityTextbox.Text = "" 
    'clearData 

    Dim authResult As Dictionary 
    Set authResult = restClient.authenticateAccount(userName, password, apiKey) 
    If Not authResult Is Nothing Then 
     'appendActivity "Connected" 
     ' Configure Excel to pull streaming updates as often as possible 
     Application.RTD.ThrottleInterval = 0 
     ' Uncomment for real-time prices - this is very CPU intensive 
     ' Buffer interval defaults to 500ms 
     'Application.WorksheetFunction.RTD "IG.api.excel.RTD.IGApiRTDServer", "", "bufferInterval", "0" 
     ' Set manual refresh to true from very remote locations 
     ' Application.WorksheetFunction.RTD "IG.api.excel.RTD.IGApiRTDServer", "", "manualRefresh", "true" 
     ' This will require manually calling refresh to update lighstreamer subscriptions, i.e. 
     ' Application.WorksheetFunction.RTD "IG.api.excel.RTD.IGApiRTDServer", "", "refresh" 
     Dim maxPriceRequestsPerSecond As Double 
     maxPriceRequestsPerSecond = 0 ' all available updates 
     If restClient.streamingAuthentication(maxPriceRequestsPerSecond) Then 
      m_loggedIn = True 
      'populateWatchlists 
      'populateAccounts 
      'manualStreamingRefresh 
     'Else 
     ' appendActivity "Lightstreamer connection failure" 
     End If 
    Else 
     MsgBox "Authentication failed" 
    End If 

End Sub 

ありがとうございます。 乾杯、 ジョー

+0

検索、あなたは解決策を見つける(または関連を見て)します。 – BitAccesser

+4

あなたの参照に 'Microsoft Scripting Runtime'を含めてください。 – YowE3K

答えて

3

YowE3kが言った@としてMicrosoftスクリプトランタイムへの参照を追加します。

をVBAエディタで:

ツール - >は

AddRef1

検索Microsoftスクリプトを参照しますランタイム

チェックする

"VBA辞書" のClick大丈夫

AddRef2

関連する問題