Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using Visual Basic 6.5 and Excel 2003 SP3. Here's some excerpts
from a sub: Dim rMyRange As Range With wksMyWorksheet ' name of a worksheet Set rMyRange = Range(.Cells(4, 2), .Cells(10, 2)) End With With rMyRange.Validation .Delete .Add Type:=Excel.xlValidateDecimal, AlertStyle:=Excel.xlValidAlertStop, Operator:=Excel.xlGreaterEqual, Formula1:="0" .IgnoreBlank = False .InCellDropdown = False .ErrorTitle = "Error" .ErrorMessage = "Must be = 0" .ShowError = True End With When I run this, I sometimes get, when adding the validation: Run-time error '-2147417848 (80010108' : Method 'Add' of object 'Validation' failed. Sometimes it says "Automation error. The object invoked has disconnected from its clients". The workaround I have is to do: rMyRange.Select With Selection.Validation ... End With instead, which cures the problem, but I don't see why this should be necessary or why the original code fails. The Microsoft page http://support.microsoft.com/default...;en-us;Q319832 is not enlightening. Any ideas? Thanks in advance, Philip. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automation error with XLA addin, fails on commandbarbutton onaction | Excel Programming | |||
Adding Validation When Source Validates To Error? | Excel Programming | |||
Validation fails on copying | Excel Discussion (Misc queries) | |||
VBA Inserted Data Validation Fails | Excel Programming | |||
Excel fails to open workbook using Automation from VB 6 | Excel Programming |