I'm trying to code into my program the ability to automaticallyclick "ok" on a message box that excel automatically pops up (I'mdeleting a worksheet - and excel asks if this is ok).Any ideas on how I can ignore the trivial message box?
You need to switch off alerts before deleting the worksheetApplication.DisplayAlerts = FalseOnce the worksheet has been deleted switch alerts back on withApplication.DisplayAlerts = True.
You want to use the DisplayAlerts option. For example:Application.DisplayAlerts=False'Your delete code goes hereApplication.DisplayAlerts=TrueFor more related info, see:http://www.ozgrid.com/VBA/ExcelVBAErrors.htm