WordBasic Error Messages

When you run a macro and an error occurs, you can get more information by choosing the Help button in the error message box. For information about an error message at any time, see "Error Messages" in Help. Choose an error from the list to display the corresponding Help topic. The following list of macro errors includes error numbers you can use with the Error statement.

Note

In Windows, if an untrapped error occurs in a macro while Word is minimized, the macro halts, Word remains minimized, and the Word icon flashes. When Word is maximized, an error message that indicates the nature of the error is displayed.

Error Number

Error Message

5

Illegal function call

6

Overflow

7

Out of memory

9

Subscript out of range

11

Division by zero

14

Out of string space

22

Invalid array dimension

24

Bad parameter

25

Out of memory (stack space)

26

Dialog needs End Dialog or a push button


Error Number

Error Message

28

Directory already exists

39

CASE ELSE expected

51

Internal error

52

Bad file name or number

53

File not found

54

Bad file mode

55

File already open

57

Device I/O error

62

Input past end of file

64

Bad file name

67

Too many files

74

Rename across disks

75

Path/File access error

76

Path not found

100

Syntax error

101

Comma missing

102

Command failed

103

Dialog record variable expected

104

ELSE without IF

105

END IF without IF

109

INPUT missing

111

Expression too complex

112

Identifier expected

113

Duplicate label

114

Label not found

115

Right parenthesis missing

116

Argument-count mismatch

117

Missing NEXT or WEND

118

Nested SUB or FUNCTION definitions

119

NEXT without FOR

120

Array already dimensioned

122

Type mismatch

123

Undefined dialog record field

124

Unknown Command, Subroutine, or Function

125

Unexpected end of macro


Error Number

Error Message

126

WEND without WHILE

127

Wrong number of dimensions

129

Too many nested control structures

130

SELECT without END SELECT

131

Illegal Redim to dialog record

132

External call caused string overflow

133

Wrong number or type of arguments for DLL call

134

An argument to a function contained an illegal date or time.

135

The () statement is not available in Word for ().

136

The () statement is not available in Word for ().

137

The specified path is not a valid path option.

138

The current selection cannot be modified by this command.

139

Only one user dialog may be up at any time.

140

Dialog control identifier does not match any current control.

141

The () statement is not available on this dialog control type.

142

Specified application is not currently running

143

The dialog control with the focus may not be disabled or hidden.

144

Focus may not be set to a hidden or disabled control.

149

The () command cannot be called as a function.

150

Dialog control identifier is already defined.

152

This command is not available because no document is open.

155

The selection does not start in a field.

157

The field cannot contain data.

158

The value of one of the fields is too low.

159

The value of one of the fields is too high.

160

Wrong number of parameters

161

Cannot change dialogs when focus is changing (action 4)

162

The () command can only be called as a function.

163

This statement can only be used when a user dialog is active.

164

Array variable has not been initialized.

500

Cannot initiate link

501

Invalid channel number

502

Application does not respond

503

Process failed in other application

504

Window does not exist


Error Number

Error Message

505

Cannot activate application

506

Cannot send keys

508

Other application is busy

509

The () command is not available because ().

511

No such macro or command

512

Value out of range

513

String too long

514

Document not open

528

Unable to load spelling checker

529

Cannot open dictionary

530

Dialog box description too complex

535

Macro cannot be run because it is already running.

536

There is no macro with that name.

537

Unable to run macro specified

538

Unable to edit macro specified

539

Unable to rename macro specified

540

Unable to delete macro specified

541

Unable to set description of macro specified

543

Unable to open specified library

544

Unable to execute the scroll command; the scroll bar is not active.

545

The () statement is currently disabled.

546

Footnotes or endnotes must start at 1 if numbering is not continuous.

547

Network Permission Error

549

The specified menu or menu item does not exist.

551

Word is unable to perform this action because the specified template is locked.

552

Word is unable to perform this action because the specified template does not exist.

553

Unable to create macro specified

554

No drawing range has been set.

555

The bookmark specified for the drawing range is invalid.

556

Wrong drawing object type for this command

557

Could not insert the drawing object

558

At least one subdocument in this master document is locked. No changes can be made to any locked subdocuments.

559

The current selection is a block.


Error Number

Error Message

560

The revision marks are not visible.

561

Document is protected

562

ToolsGrammarStatisticsArray cannot be run on a document that contains more than one language format.

563

The document is not a master document.

564

There are no subdocuments in that direction.

565

The specified document is not in the Add-in list.

566

The specified Word library cannot be unloaded because it is in use.

567

Cannot add more than 25 items in the dropdown list box

568

The specified font doesn't exist

569

PatternMatch and SoundsLike parameters cannot both be set to 1

570

Cannot sort arrays with more than two dimensions

574

Address not found

575

MAPI returned error

576

Cannot add address to Personal Address Book

577

You must specify display name for a new address

578

Unknown document property

579

Cannot delete a built-in document property

580

Unknown link

581

Cannot change the value of a read-only document property

582

Unable to load specified library

583

Illegal function name