Option Explicit
Sub copyDataToClosedWorkbook()
Dim wbTo As Workbook
Dim wbFrom As Workbook
Set wbFrom = ThisWorkbook
' prevent the user from seeing the workbook being opened
Application.ScreenUpdating = False
'change foldername
Set wbTo = Workbooks.Open("d:\a.xls", _
False, True)
wbTo.Sheet1.Cells(10, 4).Value = wbFrom.Sheet1.Cells(1, 3).Value
wbTo.Close True 'save & close
Application.ScreenUpdating = True
Set wbTo = Nothing
Set wbFrom = Nothing
End Sub
this is my code but somehow its giving me an error '438' that the object does not support property (the bold line)
and can i using it on xlsx files ? kindly help
Bookmarks