LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turn off "CALCULATE" on bottom of Excel worksheet. near "Ready" chrispal86 Excel Discussion (Misc queries) 2 February 2nd 10 08:36 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Excel "Move or Copy" and "Delete" sheet functions dsiama Excel Worksheet Functions 1 December 28th 07 01:57 PM
How2 Delete "Not exist" charts/sheets? fatfish[_4_] Excel Programming 4 July 22nd 04 02:17 PM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM


All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"