Table of contents

所需常量表达式Constant expression required

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

必须初始化常量。此错误有以下的原因和解决方案:A constant must be initialized. This error has the following causes and solutions:

  • 试图初始化常量与变量和一个用户定义的类型、 对象或函数调用的返回值的实例。You tried to initialize a constant with a variable, and instance of a user-defined type, an object, or the return value of a function call.

    初始化常量文本、 以前声明的常数或文本和联接运算符 (除Is逻辑运算符) 的常量。Initialize constants with literals, previously declared constants, or literals and constants joined by operators (except the Is logical operator).

  • 数组array

    声明一个动态数组的过程中,声明使用ReDim数组并使用变量指定元素的数量。To declare a dynamic array within a procedure, declare the array with ReDim and specify the number of elements with a variable.

有关其他信息,请选择相关项并按 F1(在 Windows 中)或 HELP(在 Macintosh 上)。For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

© 2018 Microsoft