View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
OTWarrior via OfficeKB.com OTWarrior via OfficeKB.com is offline
external usenet poster
 
Posts: 14
Default macro to automatcially delete a worksheet

I have added some code to my access form, which exports to excel in several
sheets.
The code is:

.ActiveWindow.SelectedSheets.Delete

this deletes the current sheet (which i have to do, as i copy data from it,
and this makes the sheet redundant).

However, the problem is the delete function brings up a dialog box asking you
to confirm the deletion, which i want to bypass/automatically select ok.

I ran a macro to get this code, so i guessed it would show all the workings
(which it doesn't)
Since this is not a normal dialog box, I could not get the VBbuttonok etc to
work.

How can I autoselect ok on the messagebox? Or is there a better way of
deleting a worksheet?

--
Message posted via http://www.officekb.com