Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Automation error with validation object

Hi,

I was using the following code to create a validation list in column
A:

Sub rProducts()
Application.Goto
Reference:=Worksheets("ProductMaster").Range("a4:a 65536")
ActiveWindow.ScrollRow = 1
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=categories"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub

This was working fine. Suddenly, it has stopped working and
"Automation Error" is displayed. When debug is clicked, the line
beginning ".Add" is highlighted.

Please help with a solution.

PS: I had posted this earlier and Bob Phillips had suggested to check
whether the named "categories" existed. It does exist.

Is there any other way of adding a validation list in a range using a
named category or range?. As the validation list range is dependent on
a value in another cell of another sheet, I need to do this through
VBA

Regards,
Raj
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Automation error with validation object

On May 28, 1:11*pm, Raj wrote:
Hi,

I was using the following code to create a validation list in column
A:

Sub rProducts()
* * * *Application.Goto
Reference:=Worksheets("ProductMaster").Range("a4:a 65536")
* * ActiveWindow.ScrollRow = 1
* * With Selection.Validation
* * * * .Delete
* * * * .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
* * * * xlBetween, Formula1:="=categories"
* * * * .IgnoreBlank = True
* * * * .InCellDropdown = True
* * * * .InputTitle = ""
* * * * .ErrorTitle = ""
* * * * .InputMessage = ""
* * * * .ErrorMessage = ""
* * * * .ShowInput = True
* * * * .ShowError = True
* * End With
End Sub

This was working fine. Suddenly, it has stopped working and
"Automation Error" is displayed. When debug is clicked, the line
beginning ".Add" is highlighted.

Please help with a solution.

PS: I had posted this earlier and Bob Phillips had suggested to check
whether the named "categories" existed. It does exist.

Is there any other way of adding a validation list in a range using a
named category or range?. As the validation list range is dependent on
a value in another cell of another sheet, I need to do this through
VBA

Regards,
Raj


Ran this several times and had no problems.

Sub rProducts()
With Worksheets("ProductMaster").Range("a4:a65536").Val idation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="=categories"
.IgnoreBlank = True
.InCellDropdown = True
End With
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automation error the object invoked has disconnected from its clie usch Excel Programming 0 September 3rd 07 08:56 PM
Automation Error: Object Disconnected From Clients Sprinks Excel Programming 1 October 24th 06 08:30 PM
New object/automation error Stephen Excel Programming 2 January 26th 06 12:11 AM
Automation Error: The Object Invoked Has Disconnected from Its Clients Vaibhav Dandavate Excel Programming 0 September 8th 03 04:05 PM


All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"