To resolve this problem, follow the steps in the method that applies to your version of Excel. In Excel 2007, use Method 1. In Excel 2003, Excel 2002, and Excel 2000, use Method 2.
Method 1: Temporarily toggle the option from "Nothing (hide objects)" to All
In Excel 2007, temporarily toggle the option from
Nothing (hide objects) to
All, and then insert the rows or columns as needed. To do this, follow these steps:
- In the upper-left corner of the Excel window, click the Microsoft Office button.
- At the bottom of the menu, click Excel Options.
- Click Advanced from list of options on the left.
- Scroll down to the Display options for this workbook section, and then click All under For objects, show:, and then click OK.
Notes To use the keyboard shortcut to toggle this selection, press CTRL+6.
If these steps do not let you hide rows or columns or insert rows or columns in Excel 2007, try the steps in method 2.
Method 2: Change the position property of the object to Move and size with cells
To work around this issue, Excel 2003, Excel 2002, and Excel 2000, change the position property of the object to
Move and size with cells. To do this, follow these steps:
- If the object is a cell comment, select the cell that contains the comment, right-click the cell, and then click Show Comment or Show/Hide Comments.
Note This makes the comment visible. - Move the pointer to the edge of the object until the pointer changes into a white arrow with four small black arrows on the pointer. Then, click the object to select it.
- In Excel 2003 and earlier version of Excel, click <object name> on the Format menu.
Note In this menu command, <object name> is the name of the object, such as "Comment" or "AutoShape."
In Excel 2007, click Format <object name>.
- In the Format dialog box, click the Properties tab.
- Click Move and size with cells, and then click OK.
- If you want to hide the cell comment again, right-click the cell that contains the comment, and then click Hide Comment.
Follow these steps for each object in the affected column as described in the "Cause" section. When you hide the columns, you do not receive the error message.
Alternative Method: Change the property on all the objects on the active worksheet
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Note Running the following macro sets the property that is mentioned in Method 1 for all the objects on the active worksheet. Because this setting causes objects to resize when the rows and the columns that are associated with the object are resized, it can cause unexpected results when it displays the objects on the worksheet if you resize the rows and the columns. Consider this problem before you run the macro in your file.
To change the property on all the comments on the active worksheet, run the following macro.
Sub Test()
Dim s As Shape
On Error Resume Next
For Each s In ActiveSheet.Shapes
s.Placement = xlMoveAndSize
Next
End Sub