VBA里怎么禁止弹出对话框,我用了常用的禁止弹出对话框代码,没有作用啊,请大师们帮帮忙
PrivateSubCommandButton2_Click()DimiAsLong,FileNamePath_strAsString,File_strAsStringD...
Private Sub CommandButton2_Click()Dim i As Long, FileNamePath_str As String, File_str As StringDim Open_File As Workbook, Sht As Worksheet
Erase arrk = 0
Call RecursiveDir("E:\备份")Call RecursiveDir("E:\备份") k = k + 1ReDim Preserve arr(1 To k)arr(k) = "E:\备份\特殊处理规定.xls"k = k + 1ReDim Preserve arr(1 To k)arr(k) = "E:\备份\上海出票政策.xls" Application.DisplayAlerts = False Application.ScreenUpdating = False For i = 1 To k '遍历所有选中的文件 FileNamePath_str = arr(i) '获取工作全名 File_str = Split(FileNamePath_str, "\")(UBound(Split(FileNamePath_str, "\"))) '文件名 Set Open_File = Workbooks.Open(FileName:=FileNamePath_str) For Each Sht In Workbooks(File_str).Sheets If ISCM(Sht.Name) Then ThisWorkbook.Sheets(Sht.Name).Delete End If Sht.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count) Next Workbooks(File_str).Close False Next iApplication.DisplayAlerts = TrueApplication.ScreenUpdating = True
End Sub
以上代码应该怎么改 展开
Erase arrk = 0
Call RecursiveDir("E:\备份")Call RecursiveDir("E:\备份") k = k + 1ReDim Preserve arr(1 To k)arr(k) = "E:\备份\特殊处理规定.xls"k = k + 1ReDim Preserve arr(1 To k)arr(k) = "E:\备份\上海出票政策.xls" Application.DisplayAlerts = False Application.ScreenUpdating = False For i = 1 To k '遍历所有选中的文件 FileNamePath_str = arr(i) '获取工作全名 File_str = Split(FileNamePath_str, "\")(UBound(Split(FileNamePath_str, "\"))) '文件名 Set Open_File = Workbooks.Open(FileName:=FileNamePath_str) For Each Sht In Workbooks(File_str).Sheets If ISCM(Sht.Name) Then ThisWorkbook.Sheets(Sht.Name).Delete End If Sht.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count) Next Workbooks(File_str).Close False Next iApplication.DisplayAlerts = TrueApplication.ScreenUpdating = True
End Sub
以上代码应该怎么改 展开
3个回答
展开全部
没有问题啊,你关闭打开重新运行一下。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
987122817@qq.com
把文件发我邮箱看看?
追问
我现在在公司,发不了啊,怎么办
追答
那这样,在所有 Delete 语句前面一行加上 Application.DisplayAlerts = False
注意看你调用的子过程里面也要加上这句。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询