Microsoft KB Archive/937619

= The &quot;Worksheet_Change&quot; or &quot;Workbook_SheetChange&quot; event does not occur when you use the Cut command to delete a cell that contains a query table or a PivotTable and then try to paste the cell in Excel =

Article ID: 937619

Article Last Modified on 5/30/2007

-

APPLIES TO


 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003

-



SYMPTOMS
Consider the following scenario. In a new workbook in Microsoft Office Excel 2007 or in Microsoft Office Excel 2003, you create a query table or a PivotTable that is based on an external data source. You set an event handler for a Worksheet_Change event or for a Workbook_SheetChange event.

You use the Cut command to delete a cell that contains the query table or the PivotTable. Then, you try to paste the cell into another cell in the worksheet. When you do this, the Worksheet_Change or Workbook_SheetChange event does not occur.

Note The Worksheet_Change or Workbook_SheetChange event occurs if you copy a cell that contains the query table or the PivotTable and then paste the cell into another cell. The event also occurs if the PivotTable or the query table is based on internal data.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the problem
 Start Excel 2007. Click the Data tab, and then click a button in the Get External Data group to receive data from the external data source. Press ALT+F11 to start Microsoft Visual Basic for Applications (VBA). In the Project - VBAProject window, double-click ThisWorkbook.  Copy and then paste the following code into the VBA window. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Stop End Sub  Close the VBA window. Use the Cut command to delete the cell in the worksheet that contains the PivotTable, and then paste the cell into another cell.

Notice that nothing happens.</li> Copy the cell in the worksheet that contains the PivotTable, and then paste the cell into another cell.

Notice that the VBA window appears and that the Stop line is highlighted.</li></ol>

Additional query words: XL2003 XL2007

Keywords: kbbug kbexpertiseinter kbtshoot KB937619

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.