Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Detect Password Protection

Is there any way to detect when an XLS is password protected?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Detect Password Protection

Keith
Something like this perhaps:
Sub testme02()
Dim wks As Worksheet
Set wks = ActiveSheet
With wks
If .ProtectContents _
Or .ProtectDrawingObjects _
Or .ProtectScenarios Then
MsgBox "oh, oh. Somekind of protection"
End If
End With
End Sub

HTH Otto

"Keith Ralston" wrote in message
m...
Is there any way to detect when an XLS is password protected?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Detect Password Protection

Can this be done before I attempt to open the spreadsheet?

I need to process a large number of XLS files. I want to note pwd
protected files as exceptions. I am using Automation, not VBA as you
have indicated below.

Otto Moehrbach wrote:
Keith
Something like this perhaps:
Sub testme02()
Dim wks As Worksheet
Set wks = ActiveSheet
With wks
If .ProtectContents _
Or .ProtectDrawingObjects _
Or .ProtectScenarios Then
MsgBox "oh, oh. Somekind of protection"
End If
End With
End Sub

HTH Otto

"Keith Ralston" wrote in message
m...

Is there any way to detect when an XLS is password protected?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Detect Password Protection

Otto's code checks for worksheet protection. It kind of sounds like you want to
check for the file|open type of protection.

I'm not sure how you're automating this (VB??), but if I were doing it in
excel's VBA, I could do try to open it with a password of "" and if it failed,
it had a real password:

Here's a link that uses Excel to make a report for each workbook in a folder:
http://groups.google.com/groups?thre...E05F%40msn.com

Keith Ralston wrote:

Can this be done before I attempt to open the spreadsheet?

I need to process a large number of XLS files. I want to note pwd
protected files as exceptions. I am using Automation, not VBA as you
have indicated below.

Otto Moehrbach wrote:
Keith
Something like this perhaps:
Sub testme02()
Dim wks As Worksheet
Set wks = ActiveSheet
With wks
If .ProtectContents _
Or .ProtectDrawingObjects _
Or .ProtectScenarios Then
MsgBox "oh, oh. Somekind of protection"
End If
End With
End Sub

HTH Otto

"Keith Ralston" wrote in message
m...

Is there any way to detect when an XLS is password protected?





--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Detect Password Protection

There is free utility to searche for password protected documents
(Word, Excel) on your computer http://lastbit.com/findpswdoc.asp

Keith Ralston wrote in message om...
Is there any way to detect when an XLS is password protected?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protection in macro ( Anybody can view my password in VB Sherees Excel Discussion (Misc queries) 2 January 24th 10 10:05 PM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Password Protection Kiley Excel Discussion (Misc queries) 7 October 8th 09 02:25 PM
password protection Rover Excel Discussion (Misc queries) 7 March 12th 09 10:50 PM
Detect Password Protection on a Sheet Chris Gorha Excel Programming 2 January 10th 04 09:17 AM


All times are GMT +1. The time now is 12:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"