macro to automatcially delete a worksheet

  • Thread starter OTWarrior via OfficeKB.com
  • Start date
O

OTWarrior via OfficeKB.com

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top