Import Cell Values From An Unopen XLS File
Dim Wb1 As Workbook 'Workbook to copy to
Set Wb1 As ActiveWorkbook
Dim Wb2 As Workbook ' Workbook to copy from
Set Wb2 = Workbooks.Open("F:\Larry\TEST1_Backup.xls")
Wb2.Sheets("Field Sheet").Range(Cells(1, 1), Cells(150, 6)).Copy
Destination:= Wb1.Sheets("YourSheet").Range("YourRange")
Wb2.Close False
or
Wb2.Sheets("Field Sheet").Range(Cells(1, 1), Cells(150, 6)).Copy
Wb1.Sheets("YourSheet").Range("YourRange").PasteSp ecial xlPasteValues
Regards,
Alan
"vbman" wrote in message
news:yIeGh.377$3i.360@trnddc01...
Hello all. I am trying to copy values from an unopened Excel spreadsheet
to
one that I have open. I cannot figure out how to do this. When I use the
following, cells from the open sheet get selected:
Set xlw = xl.Workbooks.Open("F:\Larry\TEST1_Backup.xls")
xlw.Activate
xlw.Sheets("Field Sheet").Select
Range(Cells(1, 1), Cells(150, 6)).Copy
I am using Excel 2000. Please help. TIA.
Larry
|