Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.87 KB

type-not-supported-in-visual-basic.md

File metadata and controls

30 lines (20 loc) · 1.87 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
Type not supported in Visual Basic
vblr6.chm1015664
vblr6.chm1015664
59add4f9-d15a-7342-e7fc-4b21420a5e41
06/08/2017
medium

Type not supported in Visual Basic

Not all types are supported in Visual Basic. This error has the following cause and solution:

  • You tried to use a type in your program that has no equivalent in Visual Basic for Applications. For example, Visual Basic has no pointer or unsigned integer type, so if you try to create a variable of one of those types from an object library, this error occurs.

    In the following example, even though Rainbow may be a valid structure, Visual Basic can't create a variable of that type if it contains a type Visual Basic doesn't recognize:

      Dim MyVar As Rainbow    ' Causes error. 

    If the type is a valid parameter type for a function in an object library, this error means only that you can't create a variable of that type in your own code. Although you can't always declare variables with a data type specified in an object's documentation, there is often a Visual Basic equivalent.

    For example, although Visual Basic has no pointer type, you can pass a pointer to a function to an API function by using the AddressOf operator. Also, check the Variant type's subtypes. You can often use them as equivalents of types not offered directly in Visual Basic. In some cases, however, Visual Basic simply has no equivalent. For example, data pointers aren't available.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

[!includeSupport and feedback]