PDA

View Full Version : Copy fail in Automation



lclqt12
01-22-2007, 04:36 PM
I use code :

Dim wb as Variant
set wb = Excel.WorkBooks.Open(path)
Windows(FileName).Activate 'FileName is the name of excel file which is
'opened by using Excel.WorkBooks.Open and it's path is path variable

Sheets(1).Select
Range("A1:B3").Select
Selection.Copy

When that code is run, it alert "Copy fail in Automation ..... ".

How could i copy content of a file in Automation?

geekgirlau
01-22-2007, 07:31 PM
Cross posted here (http://www.vbaexpress.com/forum/showthread.php?t=11144)