Run-time error '-2147417848 (80010108) with data validation

ogo

Board Regular
Joined
Mar 15, 2011
Messages
105
Hi,

I'm trying to automatically update the list of items for data validation in multiple cells. Since I wasn't sure how to access data validation, I just quickly recorded a macro, and worked off that code. When I try to run the code I came up with I get the following error:

"Run-time error '-2147417848 (80010108)':

Automation error
The object invoked has disconnected from its clients."

I have two sheets in my workbook and i am copying data from one sheet to other in some other part of the code. Can anyone help me.

Cells(57 ,4).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="true,false"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = " "
.ErrorTitle = " "
.InputMessage = " "
.ErrorMessage = " "
.ShowInput = True
.ShowError = True
End With



Thanks in advance,
Ogo
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Have you turned calculation off? Why are you putting " " as titles and messages instead of ""? In fact try removing those rows of code.
 
Upvote 0
Hi Glenn,

i tried with Application.Calculation = xlManual
But the code throws the same error. I have seen this error in many posts, but didn't find a solution.

Thanks,

Ogo
 
Upvote 0
Which version of Excel?
Does it help if you don't select the cell first:
Code:
With Cells(57 ,4).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="true,false"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = " "
.ErrorTitle = " "
.InputMessage = " "
.ErrorMessage = " "
.ShowInput = True
.ShowError = True
End With
 
Upvote 0
Thanks Rory, with the the modification as you suggested, its working.
What was the actual reason behind the problem? I still didn't get it. I am currently using excel2003.

Thanks,
Ogo
 
Upvote 0
My guess was an issue with the dropdown being active when you delete and reset it. Not selecting the cell initially removed that problem (not that it should be a problem, IMO - I think it's a bug)
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,633
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top