Hello,
I am currently importing data from another csv file into the another excel file, however i cannot seem to get rid of the clipboard warning when i close the csv.
I have tried looked at other threads and tried to incoparate dcmd.setwarnings false[/color blue].
When i try this however, i then get an error message saying "Varaible not defined".
Can some please help because this is really bugging me.
My code is as follows:
OOch
I am currently importing data from another csv file into the another excel file, however i cannot seem to get rid of the clipboard warning when i close the csv.
I have tried looked at other threads and tried to incoparate dcmd.setwarnings false[/color blue].
When i try this however, i then get an error message saying "Varaible not defined".
Can some please help because this is really bugging me.
My code is as follows:
Code:
Sub Ast_Import()
sourcefilepath = "D:\02-EXCEL_DOCs\Gas_Aston_COT_PortAnlys.csv"
Set AstWB = Workbooks.Open(Filename:=sourcefilepath) 'Open Aston CoT FIle
dcmd.setwarnings false
lastR = Range("a65536").End(xlUp).Row ' defines the last row of the aston data
Range([a2], Cells(lastR, "BA:BA")).Copy
T2C.Worksheets("Sheet1").Activate
T2ClastR = Range("a65536").End(xlUp).Row
ActiveSheet.Cells(T2ClastR + 1, 1).PasteSpecial 'select row after last and paste
AstWB.Close
DoCmd.SetWarnings True
End Sub
OOch