Re: 'object disconnected from client ...'
- From: Christian Treffler <CTreffler.NG.Dev0@xxxxxx>
- Date: Tue, 22 Apr 2008 15:57:32 +0200
Hi James,
thanks for your reply.
James Snell wrote:
It's probably because of the delete statement being inside the with and
you're deleting part of the object you're working with.
I tried it with the following changes:
Selection.Validation.Delete
With Selection.Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="=LFM_Empty"
<snip>
It didn't change anything: Same error message. I guess that the delete
method of a validation object does only delete the validation
conditions, not the object itself.
That's the reason why the sub worked before.
Now I came back from lunch, started the computer again, and ...
.... get the same error message within all other subs which change
validation of a range.
I did some tests and found that the problem is probably related to the
fact that I'm referring to merged cells.
Here's a little sample code:
Application.Goto Reference:=Range("IPLDetail")
MsgBox Range("IPLDetail").Addres ' Shows "$R$33"
MsgBox Selection.Address ' Shows "$R$33:$U$33" (merged cells)
MsgBox Range("IPLDetail").Text ' Shows the content of the merged cell
MsgBox Selection.Text ' Runtime error 94
' Invalid use of Null
So I exchanged every "Selection.Validation" with
"Range("<name>").Validation", and it works - xxcept that sub CheckPT()
which gives me the following error:
Run-time error '-2147417848 (80010108)':
Method 'Add' of object 'Validation' failed.
The code '-2147417848 (80010108)' is identical to the previous error
'object disconnected from client ...'.
I'm still scratching my head over that one.
CU,
Christian
.
- References:
- 'object disconnected from client ...'
- From: Christian Treffler
- RE: 'object disconnected from client ...'
- From: James Snell
- 'object disconnected from client ...'
- Prev by Date: RE: disable objects on form
- Next by Date: Re: How to copy a drawing image between sheets
- Previous by thread: RE: 'object disconnected from client ...'
- Next by thread: Re: 'object disconnected from client ...'
- Index(es):
Relevant Pages
|