Yes No Auto-answer?

J

Joe Blow

I open a .dbf file, copy its contents to a workbook and then close the .dbf
file all in a macro. Problem is the computer asks me if I want to save the
copy-paste data in the clipboard or free it up. I want to free it up but I
don't want the user of the macro to have a choice. Can I set up an
autoanswer or can make it not ask that question? Excel 2000.

Many thanks.
 
T

Tom Ogilvy

Application.CutCopyMode = False

will clear the clipboard

or
Application.DisplayAlerts = False
workbooks("MyDatabase.dbf").Close SaveChanges:=False
Application.DisplayAlerts = True
 
K

Kris

Application.DisplayAlerts = False
workbooks("MyDatabase.dbf").Close SaveChanges:=False
Application.DisplayAlerts = True

Turning the displayalerts off will cause Excel to choose
the default choice, and the default for the large
clipboard message is to leave the information in the
clipboard so that it can be pasted later.
 
T

Tom Ogilvy

Thanks for the Additionan information.

If that is a problem, then

Application.CutCopyMode = False

would be appropriate

an alternative

Range("A1").Copy

would replace what is in the clipboard and would not raise the prompt.
 

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