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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turning off warning in an Excel VBA module.

Status
Not open for further replies.

mattyp75

Programmer
Aug 28, 2002
16
GB
Does anyone know how to automatically turn off warnings in an Excel VBA module? I need to automatically confirm that I want to keep data on the clipboard to paste later, and then to automatically overwrite an existing file without prompting. If anyone knows how to do this it'd be great. I have tried:

Dim AppExcel As New Excel.Application
AppExcel.DisplayAlerts = False

and this doesn't work.

I've also seen a method called AppExcel.DisplayClipboardWindow, butwhen I try and set this to false as I have done above I get a "Method 'DisplayClipboardWindow' of object '_Application' failed" error message.

Any help would be much appreciated,
Matt
 
This may do the same thing that you've already tried but give this a go:
Code:
  Application.DisplayAlerts = False

Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
Cheers, you are a genius. It works a treat. Can't see why that worked and the other didn't, but hey who are us mere mortals to questions Microsoft's code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top