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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,214,967
Messages
6,122,503
Members
449,090
Latest member
RandomExceller01

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
Back
Top