XL2001: Error Message Received After Recording a Macro to Delete Multiple Rows or Columns in a List (270089)
The information in this article applies to:
- Microsoft Excel 2001 for Mac
This article was previously published under Q270089 SYMPTOMS
When you record a macro to delete multiple rows or columns from a list, the macro does not run, and you receive the following error message:
Run-time error '438':
Object doesn't support this property or method
CAUSE
This problem occurs because the macro recorder fails to include the name of the list as an argument for ListObjects() in the code for the macro.
For example, the following two lines of code appear in a macro recorded to delete the first two columns in List1:
ActiveSheet.ListObjects("List1").ListColumns(1).Delete
ActiveSheet.ListObjects().ListColumns(1).Delete
The following is missing in the second line of code as an argument for ListObjects: WORKAROUND
To work around this problem, edit the macro manually so that it will run without error. To do this, follow these steps:
- On the Tools menu, point to Macro, and then click Macros.
- In the Macro dialog box, under Macro name, select the macro you created to delete the multiple rows or columns, and then click Edit.
- In the Code window, place the insertion point between the parentheses following ListObjects in the line that follows the first Delete command line, and then type "List#" (including the quotation marks), where List# is the name of the list you are modifying. The second line should now be identical to the line that precedes it.
- Repeat step 3 for each subsequent line containing the delete command, until they are all identical to the first Delete command line.
- On the File menu, click Close and Return to Microsoft Excel.
- Run the macro.
Notice that the two left columns of the list are deleted.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected in Microsoft Excel X for Mac.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbbug kberrmsg kbpending KB270089 |
---|
|