macro question

F

foamfollower

hopefully an easy question:
i have created an excel macro where i have to copy data from a file
and then close the file before pasting the data.
there is a pop-up window that appears at that point
asking me if i want to save data just copied to the clipboard even though
i'm closing the file. i click the 'yes' button in the pop-up, and then
past the data into a file.

the macro works great except that pop-up still appears. i click 'yes'
button while macro is running and the macro finishes.

Basically, my question is: why doesn't the macro 'remember' me pressing
the 'yes' button during the macro recording? Or, is there a way to
that pop-up, or tell clipboard to always remember what was last copied.

sorry so long winded, hope all is well.

sf
 
H

Hank Scorpio

On 19 Sep 2003 17:38:37 -0700, (e-mail address removed) (foamfollower) wrote:

You need to edit the macro. All you need to do is put the line:

Application.DisplayAlerts = False

before you close the file. Once that's done, turn it back on:

Application.DisplayAlerts = True

The macro recorder only records your responses to Excel's dialogs to
the extent that they drive the actions that you're taking. The
recorder doesn't record your responses to standard dialogs.
 
P

pfsardella

I would close the file after the paste.
After the paste is complete, add the following :

Application.CutCopyMode = False

This should eliminate that annoying MsgBox.

Then, close the file.

HTH
Paul
 

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