View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
droopy928gt[_10_] droopy928gt[_10_] is offline
external usenet poster
 
Posts: 1
Default Opening a workbook, passwords and error 1004.


Looked through this forum but am not able to find anything related. I
hope that some of you are able to help me.

I'm trying to trap a password error when opening a protected workbook
to give the user another chance to enter it. The problem is though
that when a incorrect password is used I get the general error code
1004 which is basically used for a lot of things and not specific a
password error. Same error I also get when trying to e.g. open a file
other then a workbook.

When I switch error checking on I get the 1004 error plus a description
telling me that the password is incorrect. When error checking is left
off I only get 1004 for the Err parameter. When checking
Err.Description I find it to be a null string, same for
Err.HelpContext.

It's probably a dumm question with an obvious answer but do any of you
know how to trap an incorrect password used when opening a workbook?

Thanks and best regards,

Leon


--
droopy928gt
------------------------------------------------------------------------
droopy928gt's Profile: http://www.excelforum.com/member.php...o&userid=30232
View this thread: http://www.excelforum.com/showthread...hreadid=536709