LoginSignup
5
6

More than 5 years have passed since last update.

VBAにおける、連想配列のindexアクセス

Posted at

Keys(i)やItem(i)で、i番目の要素にアクセスという情報があるが、

property let プロシージャが定義されておらず、property get プロシージャからオブジェクトが返されませんでした。

というエラーが出る場合の話。

Debug.Print dic.Keys()(0), dic.Items()(1)

とすればOK。原因は

Set dic = CreateObject("Scripting.Dictionary")

としているから。

参照設定に

    Scripting.Runtime

を追加して

Set dic = New keyword

とすれば、

Debug.Print dic.Keys(0), dic.Items(1)

で利用可能。

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6