Hi Guys,
I am trying to copy values from a closed workbook to active workbook. I have following code, but this one is not working. Any help in making it work will appreciated.
Thanks
Asad
I am trying to copy values from a closed workbook to active workbook. I have following code, but this one is not working. Any help in making it work will appreciated.
Code:
Sub CopyValues()Dim swb As Workbook, dwb As Workbook
Set dwb = ActiveWorkbook
Set swb = Workbooks.Open("S:\Leave Allocations\Leave Register.xlsm")
swb.Sheets("Emp").Range("A1:C1000").Select
Selection.Copy
dwb.Activate
ActiveWorkbook.Sheets("Emp").Range("A1:C1000").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
swb.Close
End Sub
Thanks
Asad