Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.SetWarnings False (in Excel?)

Status
Not open for further replies.

Edski

Programmer
Aug 6, 2003
430
TH
Hi,
I want to send a query from Access to Excel and then use Automation to fiddle with the columns.

In Access, I can turn Access warnings off with
Code:
DoCmd.SetWarnings False
which will ignore any stupid warnings that I don't much care about. How do I do this from within the Excel Application? I want to replace the contents of some cells using the Replace function (using code) and I don't want the user to be bothered with a dumb warning message box popping up warning them that there are no cells to replace and then having to click the ok button.
Thanks...Ed
 
1st of all - don't fall into the trap of thinking that warning messages are 'dumb' or 'stupid'. They are there for a very good reason and to code around them without giving due consideration is asking for trouble....

The method to use is:

TheExcelApp.displayalerts = false

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Sorry, foget it. I found it in another thread.
Code:
objXL.Application.DisplayAlerts = False
where objXL is my Excel.Application object.
 
Thanks Geoff. You just beat me!

yes, I know that those messages are not "dumb" to a developer. But for the end user sometimes they just annoy the hell out of you.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top