Bug: VBA Range.Copy throws Error 1004 when Form visible

M

Mike Fry

I am reporting a VBA bug. I hope this is the right place to do that.

I'm in VBA writing macros for Excel 2004 with Mac OS X.

It seems that an Error (code 1004 I think) gets thrown whenever the
Copy method of a Range gets called while a Form is visible. The Copy
method works if I hide the form before using it.

For example, in code for a VBA form in an Excel workbook:

Private Sub CommandButton2_Click()
Worksheets(1).Range("A1").Copy ' Throws Error 1004
End Sub

Private Sub CommandButton2_Click()
Me.Hide
Worksheets(1).Range("A1").Copy ' Works, no error.
Me.Show
End Sub

This does not happen with Office for Windows, or with older versions
of Office for Mac. This bug makes apps fail because of upgrade to
Office 2004.

This error also occurs if the Copy method is invoked by the debugger.

The Application is in a state where almost all menu items are disabled
when a user Form is visible, including Edit/Copy. But Range.Copy
ought not refuse to do its job when Application is in that state.
Worksheet.Copy affected too.

Mike
 
J

JE McGimpsey

I am reporting a VBA bug. I hope this is the right place to do that.

I'm in VBA writing macros for Excel 2004 with Mac OS X.

It seems that an Error (code 1004 I think) gets thrown whenever the
Copy method of a Range gets called while a Form is visible. The Copy
method works if I hide the form before using it.

For example, in code for a VBA form in an Excel workbook:

Private Sub CommandButton2_Click()
Worksheets(1).Range("A1").Copy ' Throws Error 1004
End Sub

Private Sub CommandButton2_Click()
Me.Hide
Worksheets(1).Range("A1").Copy ' Works, no error.
Me.Show
End Sub

This does not happen with Office for Windows, or with older versions
of Office for Mac. This bug makes apps fail because of upgrade to
Office 2004.

This error also occurs if the Copy method is invoked by the debugger.

The Application is in a state where almost all menu items are disabled
when a user Form is visible, including Edit/Copy. But Range.Copy
ought not refuse to do its job when Application is in that state.
Worksheet.Copy affected too.

See

http://www.mcgimpsey.com/macoffice/excel/04/xl04bugs.html#Range_Copy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top