Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i remove the clipboard warnings??

Status
Not open for further replies.

ooch1

MIS
Nov 4, 2003
190
GB
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:

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
 
aardvark,

I have now corrected my schoolboy error, but surprisingly enough I still get the same error message.

Any ideas??

OOCh
 
Hmm... Try this:

Code:
dim sourcefilepath as string

before assigning the value to sourcefilepath.
 
This would have been better posted in another forum such as Microsoft Office, rather than an Access forum.

Try replacing the clipboard contents with something from the target worksheet before you close the source.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Thanks for your help guys, but i have found the answer.

Basically, all i have done is to include:
Code:
Application.CutCopyMode = False

...after the pasting of the data and this seems to work fine.

Cheers again

OOch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top