LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Copy data from another workbook to any open workbook

Hi,

I'm using XL2007 on Vista. I want to put in Personal.xlsb a code which
will copy range of data from another workbook and paste it to
activecell in any open workbook. I wrote some code but there seems to
be an error when trying to paste values("Pastespecial methow of range
class failed").

Sub Load()

Dim wbA As Workbook
Dim cellA As Range


Set wbA = Workbooks.Open(Filename:="H:\My Documents\TESTS\CALL
LIST.xls")
Windows("CALL LIST.xls").Activate
Workbooks("CALL LIST.xls").Worksheets(1).Range("A2:A20").Copy
Windows("CALL LIST.xls").Close (False)
Application.ActiveWindow.ActiveCell.Select
ActiveCell.PasteSpecial (xlPasteValues)

End Sub

Can someone advise on the solution?

thanks and regards
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Open closed workbook/Search data tables/Return data to open workbook Hugh Adams Excel Discussion (Misc queries) 0 August 18th 10 02:04 PM
Copy Data from Multiple Closed Workbooks to Open Workbook Kris Excel Programming 3 October 31st 06 08:36 PM
1.Open workbook. 2 copy data. 3 replace data. 4 save workbook. Cristobalitotom Excel Programming 0 July 6th 06 12:24 AM
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Excel Programming 1 April 1st 06 08:48 PM
Open a password protected excel workbook from second workbook to fetch data using dynamic connection kaustav choudhury Excel Programming 2 April 3rd 04 06:18 AM


All times are GMT +1. The time now is 09:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"