!
Access Excel, Excel
, .
, .
Dim oXls As Object 'Excel.Application
Dim oBook As Object 'Excel.Workbook
Dim oSheet As Object 'Excel.Worksheet
Set oXls = CreateObject("Excel.Application")
Set oBook = oXls.Workbooks.Add '
Set oSheet = oBook.Worksheets.Item(1)
' ,
With oBook.Sheets("").Range(oBook.Sheets("").Cells(2, 1), oBook.Sheets("").Cells(50, 1)).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="="
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = _
" ."
.ShowInput = True
.ShowError = True
End With
:
.Add Type:=
xlValidateList, AlertStyle:=
xlValidAlertStop, Operator:= _
xlBetween, Formula1:="="
,
.Add Type:=
oXls.xlValidateList, AlertStyle:=
oXls.xlValidAlertStop, Operator:= _
oXls.xlBetween, Formula1:="="
.Add Type:=
oBook.xlValidateList, AlertStyle:=
oBook.xlValidAlertStop, Operator:= _
oBook.xlBetween, Formula1:="="
.Add Type:=
oXls.oBook.xlValidateList, AlertStyle:=
oXls.oBook.xlValidAlertStop, Operator:= _
oXls.oBook.xlBetween, Formula1:="="
.Add Type:=
oXls.oBook.XlDVType.xlValidateList, AlertStyle:=
oXls.oBook.XlDVAlertStyle.xlValidAlertStop, Operator:= _
oXls.oBook.XlFormatConditionOperator.xlBetween, Formula1:="="
.Add Type:=
XlDVType.xlValidateList, AlertStyle:=
XlDVAlertStyle.xlValidAlertStop, Operator:= _
XlFormatConditionOperator.xlBetween, Formula1:="="
.Add Type:=
oXls.XlDVType.xlValidateList, AlertStyle:=
oXls.XlDVAlertStyle.xlValidAlertStop, Operator:= _
oXls.XlFormatConditionOperator.xlBetween, Formula1:="="
.Add Type:=
Microsoft.Office.Interop.Excel.XlDVType.xlValidateList, AlertStyle:=
Microsoft.Office.Interop.Excel.XlDVAlertStyle.xlValidAlertStop, Operator:= _
Microsoft.Office.Interop.Excel.XlFormatConditionOperator.xlBetween, Formula1:="="
.
http://www.sql.ru/forum/1140079/izbavlyaemsya-ot-references-excel-oshibka-xlvalidatelist