Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
vba从outlook将下拉列表插入excel中的单元格_Excel_Vba_Outlook - Fatal编程技术网

vba从outlook将下拉列表插入excel中的单元格

vba从outlook将下拉列表插入excel中的单元格,excel,vba,outlook,Excel,Vba,Outlook,我试图在第25列的下一行中插入一个下拉列表/验证列表 我在下面一行得到一个编译错误:Formula1:=Join(MyList,“,”) 我想这是因为outlook不支持,有人能告诉我如何让它工作吗?谢谢删除/注释掉您所有的Const作业。直接使用xl枚举很好,但是定义与验证参数同名的变量可能不是一个好主意 Const Delete As Integer = 3 Const Add As Integer = 4 Const xlValidateList As Intege

我试图在第25列的下一行中插入一个下拉列表/验证列表

我在下面一行得到一个编译错误:
Formula1:=Join(MyList,“,”)


我想这是因为outlook不支持,有人能告诉我如何让它工作吗?谢谢

删除/注释掉您所有的
Const
作业。直接使用xl枚举很好,但是定义与验证参数同名的变量可能不是一个好主意

    Const Delete As Integer = 3
    Const Add As Integer = 4
    Const xlValidateList As Integer = 5
    Const AlertStyle As Integer = 6
    Const xlValidAlertStop As Integer = 7
    Const Operator As Integer = 8
    Const xlBetween As Integer = 9
    Const Formula1 As Integer = 10
    Const Join As Integer = 11

 intRow4 As Integer, _
intRow4 = excWks4.UsedRange.Rows.Count + 1

         Dim MyList(3) As String
                               MyList(0) = "Yes"
                               MyList(1) = "No"
                               MyList(2) = "Declined"
                               With excWks4.Cells(intRow4, 25).Validation
                               .Delete
                               .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
                               Operator:=xlBetween, Formula1:=Join(MyList, ",")
                               End With