Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check If HasPassword without opening workbook

Status
Not open for further replies.

Chance1234

IS-IT--Management
Jul 25, 2001
7,871
US
I have a bit of code that looks somethign like this

Code:
 XL = XL2.Workbooks.Open(strFolder & "\" & strFileName, False)
                
                    alinks = XL.LinkSources
                    If Not IsEmpty(alinks) Then
                        For n = 1 To UBound(alinks)

                                ..........

What Im doing is going through a folder of excel spreadsheets and then looping through the link sources

all fine and dandy

except for spreadsheets which are password protected , I need to open the workbook to get the link info, but is there any way of finding out if a excel workbook is password protected without opening it ?




Chance,

F, G + Its official, its even on a organisation chart et all
 
There is a password property of a workbook which shows ">>**" when interrogated but I would've thought you would need to open the workbook to get that property

Other than that, you may get some joy with the ExecuteExcel4Macro method which can be used to extract data from a closed workbook without opening it. If there is an OPEN command for it then this may well do what you want...


Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top