M
merf
Hi,
I'am using Excel 2000 and win2000 prof
I copy the range("a1:f10") from one file into another file. On this last
file, there is only one worksheet which is protected by a password.
I trie to bypass this password, but mostly (not allways) an error occur
(err.number 1004 with description that "the method op pastespecial of the
class range is not succesfull.)
the error occur after this part of code
'------------------------------------
workbooks.open filename:"d:\file2.xls",updatelinks:=0 ,readonly:=false
ActiveSheet.Unprotect "password" ' this should uninstall the password
worksheets("sheet1").range("a1:f9").pastespecial
paste:=xlvalues,operation:=xlnone,skipBlanks:=false, transpose:=false
'Now the error 1004 occurs
ActiveSheet.Protect "password" ' to reinstall the password
'-------------------------
Very strange that sometimes the error does not occur and the code proceeds !
Quid ??
What's causes (mostly) this error ??
Thanks for your help, Merf
I'am using Excel 2000 and win2000 prof
I copy the range("a1:f10") from one file into another file. On this last
file, there is only one worksheet which is protected by a password.
I trie to bypass this password, but mostly (not allways) an error occur
(err.number 1004 with description that "the method op pastespecial of the
class range is not succesfull.)
the error occur after this part of code
'------------------------------------
workbooks.open filename:"d:\file2.xls",updatelinks:=0 ,readonly:=false
ActiveSheet.Unprotect "password" ' this should uninstall the password
worksheets("sheet1").range("a1:f9").pastespecial
paste:=xlvalues,operation:=xlnone,skipBlanks:=false, transpose:=false
'Now the error 1004 occurs
ActiveSheet.Protect "password" ' to reinstall the password
'-------------------------
Very strange that sometimes the error does not occur and the code proceeds !
Quid ??
What's causes (mostly) this error ??
Thanks for your help, Merf