Macro Error After PASTE() Function in Excel (68409)



The information in this article applies to:

  • Microsoft Excel for Windows 3.0
  • Microsoft Excel for Windows 4.0
  • Microsoft Excel for Windows 5.0

This article was previously published under Q68409

SUMMARY

A macro error will occur if a PASTE() function is executed, preceded by a COPY() and a DIALOG.BOX() function, respectively. (Note: this is also true for version 5.0 macro sheets, but not modules.)

MORE INFORMATION

Anytime a DIALOG.BOX() function is placed between a COPY() and a PASTE() function, the macro will halt at the PASTE() function with a macro error. The following macro will halt at line A7:
   A1:     Sample_Macro
   A2:     =SELECT(!A1:D10)
   A3:     =COPY()
   A4:     =NEW()
   A5:     =DIALOG.BOX(box)
   A6:     =SELECT(!A1)
   A7:     =PASTE()
   A8:     =RETURN()
				
Executing the DIALOG.BOX() function causes the contents of the Clipboard to disappear. To correct the problem, execute the DIALOG.BOX() function before the COPY() function.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbmacro kbProgramming KB68409