Clipboard Message on Close

Gary_Mc_Mahon

Board Regular
Joined
Apr 30, 2003
Messages
87
Hi,

I'm trying to write a macro to open a bunch of csv files and copy them into a designated place in an excel workbook. When I go to close the source data (in this case the csv file) I'm prompted with the "there is a large amount of data on the clipboard........" message. I've tried to use enable events = false but this doesnt seem to work. Has it got something to do witht the source data being a csv file?? Any tips welcome.


Sub Merge_Data()

Workbooks("TEMPLATE Weekly Billing Slide.xls").Activate

'--- Copy qry_1 to template ------

Sheets("Qry_1").Activate
Cells.Select
Selection.ClearContents

Workbooks.Open "R:\UK - Sales\.....UK data\tbl_1.csv"
Sheets(1).Activate
Cells.Select
Selection.Copy
Workbooks("TEMPLATE Weekly Billing Slide.xls").Activate
Sheets("Qry_1").Activate
Range("A1").Select
ActiveSheet.Paste
CutCopyMode = False
Workbooks("tbl_1.csv").Activate
Application.EnableEvents = False
Workbooks("tbl_1.csv").Close Savechanges:=False
Application.EnableEvents = True



End Sub

Thanks
Gary
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

LTunnicliffe

Well-known Member
Joined
May 8, 2003
Messages
767
Try:

Application.DisplayAlerts = False

*** Code ***

Application.DisplayAlerts = True
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,872
Messages
5,766,864
Members
425,382
Latest member
IronM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top