Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete an excel worksheet programmatically VB.NET

I tried following to permanently delete a worksheet from an excel workbook, however it is not working as expected,

CType(oWB1.Sheets("ABC"), Excel.Worksheet).Delete()

What is wrong here?

like image 337
Nick_R Avatar asked Jul 31 '26 14:07

Nick_R


1 Answers

oWB1.Application.DisplayAlerts = False
oWB1.Sheets("ABC").Delete
oWB1.Application.DisplayAlerts = True
like image 59
Jim Avatar answered Aug 03 '26 09:08

Jim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!