![]() |
Excel Worksheet Delete "Data may exist"
When I am attempting to delete a worksheet from a collection the
command is failing. I have disabled events, and re-enable them after I delete the worksheets. For whatever reason, it is not completing the delete operation. If I make the worksheet visible and enable the events while debugging I can see the message box pop up saying data may exist, click delete to delete permanently. I can hear the error beep when the events are disabled. I am not sure what exaclty is going on here, any help would be greatly appreciated. The code is below. xlApp.EnableEvents = False xlWb = xlApp.Workbooks.Add() tempXlWb.worksheets("WAR Premium Allocation").Copy(Befo=xlWb.Worksheets("Sheet1" )) xlWb.Worksheets("Sheet1").Delete() xlWb.Worksheets("Sheet2").Delete() xlWb.Worksheets("Sheet3").Delete() xlApp.EnableEvents = True |
Excel Worksheet Delete "Data may exist"
|
Excel Worksheet Delete "Data may exist"
Worked great, thanks!
|
All times are GMT +1. The time now is 12:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com