XLL+ Knowledge BaseXLL+ FAQs

HOWTO: How to switch off alerts and warnings during a macro

Reference: Q0046

Article Last Modified on 15-Feb-2008


The information in this article applies to:

How to switch off alerts and warnings during a macro

Issue

I would like to delete some worksheets in a macro function, but I would like to do so without having the message boxes. It should be the equivalent of the VBA: Application.DisplayAlerts = False.

Solution

To switch off alerts, use the following:

static int xlcError = 84;
int rc = CXllApp::Excel(xlcError, 1, &CXlOper(FALSE));

To switch alerts back on again:

static int xlcError = 84;
int rc = CXllApp::Excel(xlcError, 1, &CXlOper(TRUE));

Copyright © Planatech Solutions Ltd 2002-2008. All trademarks are the properties of their respective owners.