
Dim App As New MSExcel.ApplicationApp.Visible = True
Dim Wb As MSExcel.Workbook = App.WorkBooks.Open(ProjectPath & "Reports\" & "XXX集团" & Vars("yer") & "年" & Vars("mth") & "月重点工作计划.xlsx")
Dim Ws As MSExcel.WorkSheet
Dim Rg As MSExcel.Range
Ws = Wb.WorkSheets("公司月度计划")
Rg = Ws.Range("A3")
Rg = Rg.Resize(Ws.UsedRange.Rows.Count - 2,1)
Dim vd As MsExcel.Validation
vd = Rg.Validation
With vd
.Delete
.Add (Type:= xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=类别名称")
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.IMEMode = xlIMEModeNoControl
.ShowInput = True
.ShowError = True
End With
提示错误: 未声明名称xlValidateList
不知道如何在Foxtable中操作Validation,帮助文件看了许久,没搞明白,请指教!
[此贴子已经被作者于2017/8/22 22:01:23编辑过]