Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automation Error: The Object Invoked Has Disconnected from Its Clients (Excel)

Trying to put in validations for a set of Columns and am
using some macros and functions internally to do so.

Following is the code that I'm using to generate the
validations and then apply them to the specifid columns:

-----------------------------------------------------------
Sub CreateValidation(sheetValidation As String, _
rangeStart As String, rangeEnd As String, _
sheetData As String, colData As Integer, _
rowDataStart As Integer)

On Error GoTo Errorhandler
Sheets(sheetValidation).Range(rangeStart, rangeEnd).Select

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:=CreateValidationText(sheetData, colData,
rowDataStart)
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Exit Sub

Errorhandler:
MsgBox Err.Number
MsgBox Err.Description
MsgBox Err.Source

End Sub


Function CreateValidationText(sheetData As String, colData As Integer,
rowDataStart As Integer)

Dim retValue As String

For rowNumber = rowDataStart To 65535
If Sheets(sheetData).Cells(rowNumber, colData).Value = "" Then
Exit For
Else
retValue = retValue & ", " &
Sheets(sheetData).Cells(rowNumber, colData).Value
End If
Next rowNumber

MsgBox "Length: " & Len(retValue)
CreateValidationText = retValue
End Function
-----------------------------------------------------------

I apply the validation using the following call:
CreateValidation "Reports", "H4", "H65535", "DD - Report", 14, 2

I'm using the same code for 7 different sets of columns,
it just fails for the above call and generates the error:
Automation Error: The Object Invoked Has Disconnected from
Its Clients

Please help !
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 '-2147417848 (80010108)' excel 2007 Lilandra Excel Discussion (Misc queries) 0 July 9th 09 11:16 PM
Problem with excel macro - getting automation error [email protected] Charts and Charting in Excel 3 October 24th 07 05:22 PM
Automation Error: The Object Invoked Has Disconnected from Its Clients Vaibhav Dandavate Excel Programming 0 September 8th 03 04:05 PM
VB Excel Automation Error Sasanka Pinidiya Excel Programming 0 August 26th 03 08:11 AM
The object invoked has disconnected from its clinets Don[_7_] Excel Programming 2 August 20th 03 02:30 AM


All times are GMT +1. The time now is 02:37 AM.

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"