ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 97 clearcontents method fails (https://www.excelbanter.com/excel-programming/372388-excel-97-clearcontents-method-fails.html)

Peter[_58_]

Excel 97 clearcontents method fails
 
I have a spreadsheet written in 2003 with the following code

destcell.clearcontents

Where destcell is a valid range (consisting of a single cell).

This fails when running under excel 97.

I've tried

destcell.clear

but this fails as well.

Anybody recognise this behaviour?

Anybody know where I can find useful resources on what has changed?


Dave Peterson

Excel 97 clearcontents method fails
 
Is the destcell a locked cell on a protected worksheet?

Is the destcell part of a merged cell?
destcell.value = ""
may work in any version



Peter wrote:

I have a spreadsheet written in 2003 with the following code

destcell.clearcontents

Where destcell is a valid range (consisting of a single cell).

This fails when running under excel 97.

I've tried

destcell.clear

but this fails as well.

Anybody recognise this behaviour?

Anybody know where I can find useful resources on what has changed?


--

Dave Peterson

Tom Ogilvy

Excel 97 clearcontents method fails
 
Clearcontents works very well in xl97, so I think you have to look for
another cause.

If you are running this from a commandbutton, possibly you are running into
the focus issue associated with xl97 and activex controls from the control
toolbox toolbar. In that case, try changin the takefocusonclick property of
the commandbutton to false.

--
Regards,
Tom Ogilvy


"Peter" wrote:

I have a spreadsheet written in 2003 with the following code

destcell.clearcontents

Where destcell is a valid range (consisting of a single cell).

This fails when running under excel 97.

I've tried

destcell.clear

but this fails as well.

Anybody recognise this behaviour?

Anybody know where I can find useful resources on what has changed?




All times are GMT +1. The time now is 04:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com