View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Marsden Tim Marsden is offline
external usenet poster
 
Posts: 13
Default Is .xls password protected.

Thanks for the reply

I am using vb.net interop, If I try and open a workbook using
XL.Workbooks.Open("ABC.xls") without supplying a password, it prompts me for
one,.
I have DisplayAlerts = False set.

Tim


"Tom Ogilvy" wrote in message
...
Try to open it and handle the error

On Error Resume Next
set kb = Workbooks.Open("C:\MyFiles\Myfile.xls")
On Error goto 0
if kb is nothing then
msgbox "Has password"
exit sub
End if

--
Regards,
Tom Ogilvy

"Tim Marsden" wrote in message
...
Hi,

How do I tell if a .xls file has a password before I try and open it. I
don't mean a Workbook password but a file password.
The one applied when you do a save as.

Tim