VB编程操作Excel时如何取消确认对话框的提示?
Set g_xlApp = New Excel.Application
Set wkbBooks = g_xlApp.Workbooks
wkbBooks.Open (g_strPRRootPath & g_strNewWorkBook & ".xls ")
Set wkbBookTarget= wkbBooks(g_strPRRootPath & g_strNewWorkBook & ".xls ")
wkbBookTarget.Worksheets(i + 1).Delete => 程序运行到此处总是提示删除确认对话框
wkbBookTarget.Close yes => 程序运行到此处总是提示保存提示对话框
[解决办法]
g_xlApp.DisplayAlerts = False
wkbBookTarget.Worksheets(i + 1).Delete
g_xlApp.DisplayAlerts = True
[解决办法]
同意楼上的,关闭系统警告就可以了~~