Excel VBA Run-time error '13' Type mismatch -


i trying copy values 1 work book current work book error:

run-time error '13' type mismatch

i tried lot not solution 1 please me out

sub update()  dim spath string dim svalue string dim wbtarget workbook dim strname string  strname = activesheet.name ' explicitly provide 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 

wbtarget.sheets(1).range("a1:b5").value returns array of variants. cannot store in string. declare svalue variant or variant().


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -