我正在尝试将值从一本工作簿复制到当前工作簿,但出现错误:
运行时错误“13”类型不匹配
我尝试了很多但没有得到任何解决方案请帮助我
Sub Update()
Dim sPath As String
Dim sValue As String
Dim wbTarget As Workbook
Dim strName As String
strName = ActiveSheet.Name ' Explicitly provide the sheet name
sPath = "C:\Users\nikhil.surendran\Desktop\1"
Set wbTarget = Workbooks.Open("C:\Users\nikhil.surendran\Desktop\3" & ".xlsx")
sValue = wbTarget.Sheets(1).Range("A1:B5").Value
ThisWorkbook.Sheets(1).Range("A1:B5").Value = sValue
ThisWorkbook.Save
End Sub