PRB: Public Identifiers in Type Libraries May Not Have Leading Underscores in VBA

ID: Q244045


The information in this article applies to:
  • Microsoft Visual Basic for Applications (VBA) Software Development Kit (SDK), versions 5.0, 6.0, 6.1


SYMPTOMS

If the type information of an ActiveX Control contains public identifiers with leading underscores, and that control is added to a VBA-enabled application, Visual Basic for Applications (VBA) macros might not run or VBA might crash.

For example, the following enumeration in a control's type library may cause problems:


typedef enum _Names{
	Bob,
	John,
	Sally
} Names; 


CAUSE

This problem occurs because leading underscores in VBA have special meaning.


RESOLUTION

To correct this problem, all underscores in the type library of the control should be removed. For example, the previous enumeration can be changed to the following:


typedef enum tagNames{
	Bob,
	John,
	Sally
} Names; 


STATUS

This behavior is by design.

Additional query words:

Keywords : kbSDKVBA kbGrpDSO kbDSupport
Version : winnt:5.0,6.0,6.1
Platform : winnt
Issue type : kbprb


Last Reviewed: November 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.