Search code examples
vbaoption-infer

Option Infer ON


Does option infer not work in VBA?

I'm try to test out VB tutorial code on arrays in Microsoft Access.

Dim numbers = {{1, 2}, {3, 4}, {5, 6}}

This doesn't work without Option Infer ON, but you get compile error if you add it in.

Total noob question.


Solution

  • The Option Infer directive is a feature added to VB.Net in Visual Studio 2008. The VBA compiler is a completely different implementation that was never updated for Option Infer hence there is no way to make this work