如何以编程方式删除 Excel 工作表 VB.NET
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15645912/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 12:59:40 来源:igfitidea点击:
How to delete an excel worksheet programmatically VB.NET
提问by Nick_R
I tried following to permanently delete a worksheet from an excel workbook, however it is not working as expected,
我尝试从 Excel 工作簿中永久删除工作表,但是它没有按预期工作,
CType(oWB1.Sheets("ABC"), Excel.Worksheet).Delete()
What is wrong here?
这里有什么问题?
回答by Jim
oWB1.Application.DisplayAlerts = False
oWB1.Sheets("ABC").Delete
oWB1.Application.DisplayAlerts = True
回答by Quannt
How many worksheets left after you delete the worksheet "ABC" ?
删除工作表“ABC”后还剩多少工作表?
oWB1.Sheets("ABC").Delete()

