Annoying clipboard message

G

Guest

Hi there,

I've got a VBA function behind a spreadsheet that searches for, opens,
copies, pastes certain data from one sheet into the master spreadsheet and
then closes. Unfortunately I still get the 'You've copied a large amount of
data to the clipboard do you want to make this available etc' message after
the file is closed.

How can I programatically stop this message from appearing - I don't want to
keep the data on the clipboard.

The part of the function that is relevant is
ActiveSheet.Paste
Workbooks("wBook1" & sName).Close SaveChanges:=False

Thanks in advance
Sion Smith
 
N

Norman Jones

Hi Sion,

Try:

ActiveSheet.Paste
Application.DisplayAlerts = False
Workbooks("wBook1" & sName).Close SaveChanges:=False
Application.DisplayAlerts = True
 
G

Guest

Thanks Norman, it worked perfectly
Sion

Norman Jones said:
Hi Sion,

Try:

ActiveSheet.Paste
Application.DisplayAlerts = False
Workbooks("wBook1" & sName).Close SaveChanges:=False
Application.DisplayAlerts = True
 

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