Opening and closing text files

V

Vince

I am opening a text file that is tab delimited via VBA
code. After I copy the data that I want to copy, then
select the current active worksheet and paste the data, I
close the text file. When I close the text file, I always
get the message

"There is a large amount of data on the clipboard, do you
want to save the data...yes, no, cancel".

Is there a way to close the file without having to answer
this question each time?

Any ideas would be appreciated.

Vince
 
S

steve

Vince,

There are 2 ways:

Use -
Application.Displayalerts = False at the beginning of the code
and
Application.Displayalerts = True at the end.

also include
Application.CutCopyMode = False
after the paste (to clear the clipboard)

steve
 

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