Thread
:
Excel Worksheet Delete "Data may exist"
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Excel Worksheet Delete "Data may exist"
Application.DisplayAlerts = False
--
Don Guillett
SalesAid Software
"XidGarcia" wrote in message
ups.com...
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
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett