Limitations of VB and VBA Projects

Source: Internet
Author: User
ArticleDirectory
    • Widget
    • Code restrictions

Some restrictions on the VB and VBA projects have never been met by myself. The blog has replied to such problems for your reference.

A project can contain up to 32,000 "identifiers" (non-reserved words), including (but not limited to) forms, controls, modules, variables, constants, processes, functions, and objects, however, the actual number of identifiers is limited by the available memory.

The variable names in VB and VBA cannot exceed 255 characters.

The form, control, module, and class names must not exceed 40 characters.

Widget

The total number of Windows that can coexist is limited by available system resources.

The control array index is within the range of 0 to 32,767.

If you place controls on the top layer of each control, for example, nested framework controls in the framework, Visual Basic generally only accepts nested controls of no more than 25 layers.

List and listcount list box controls and combo controls: the maximum number of items is 32 K, and the size of each item is limited to 1 K (1024 bytes );
Text text box control: up to 64 K;
Caption label control: limited to 1024 bytes;
Command button control, check box control, frame control, and Option Button Control: limited to 255 characters, any title that exceeds these restrictions is truncated;
Title of custom control property: limited to 32 K
Menu Control: limited to 235 characters
All tag controls: limited to available memory size
Name all controls: limited to 40 characters

Note: in Visual Basic, the control attribute name is limited to 30 characters.

Code Restrictions

The total number of codes that can be loaded into forms, classes, or standard modules is limited to 65,534 lines. A line of code is limited to 1023 bytes. Before a line of actual text, there can be a maximum of 256 leading spaces, and a maximum of 25 operators (_) can be contained in a logical line (_).

There is no limit on the number of processes for each module. Each process can contain up to 64 KB of code. If the process or module exceeds this limit, Visual Basic produces a compilation time error. If such an error occurs, you can split a very large process into several smaller processes, or move the module-level declaration to another module to avoid such errors. Visual Basic uses a table to save the identifier names (variables, processes, constants, etc.) in the code ). Each table is limited to 64 K.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.