Annoying clipboard message

S

Sion Smith

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
 
S

Sion Smith

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
 
Top