G
getvinaygupta
I am trying to put a comma seperated string to a validation list. If
the number of comma seperated values in this string are less, things go
fine, but, when it increases...excel bombs....
Given below is the piece of code I m using :
objRecordset.Open "Select distinct(TABSCHEMA) FROM [Database$] where
DBNAME='" & dbname & "'", _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
Do Until objRecordset.EOF
schlist = objRecordset.Fields.Item("TABSCHEMA") & "," &
schlist
objRecordset.MoveNext
Loop
With Sheet1.Cells(1, 2).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:=schlist
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Am I missing something...??
Thanks
Vinay
the number of comma seperated values in this string are less, things go
fine, but, when it increases...excel bombs....
Given below is the piece of code I m using :
objRecordset.Open "Select distinct(TABSCHEMA) FROM [Database$] where
DBNAME='" & dbname & "'", _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
Do Until objRecordset.EOF
schlist = objRecordset.Fields.Item("TABSCHEMA") & "," &
schlist
objRecordset.MoveNext
Loop
With Sheet1.Cells(1, 2).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:=schlist
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Am I missing something...??
Thanks
Vinay