LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default how can I know if a workbook is locked?

Workbooks can be locked in a few different ways.

Do you mean that you have:

1. Worksheets that are portected via tools|protection?
2. The workbook is protected via Tools|protection?
3. The workbook is protected from opening via File|saveas|tools|...?
4. The VBA project is protected tools|vbaproject properties?

Each would have a different response.

And you may want to post a little more specifics (not a workbook) just for more
background.


guilhaume wrote:

hi all
I have a lot of excel file to unlock with a VB program
How can I know if a workbook is locked (not to try to treat them when
they are unlocked)
I tried to do:
Dim pass As String
pass= currentWorkbook.Password
If pass < "" Then
unlocking_treatment.....
End If
But even if the workbook is unlocked, the program passes into the If
condition and tries to unlock
While debuging, I saw that pass has the following value: "********"

what can I do?

Guilhaume

--
guilhaume
------------------------------------------------------------------------
guilhaume's Profile: http://www.excelforum.com/member.php...o&userid=12009
View this thread: http://www.excelforum.com/showthread...hreadid=319779


--

Dave Peterson
 
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
Shared Workbook Locked GrB Excel Discussion (Misc queries) 2 February 5th 10 06:02 PM
Workbook LOCKED - Up MrBill Excel Discussion (Misc queries) 0 November 16th 09 09:13 AM
Shared workbook locked Aram Excel Discussion (Misc queries) 0 April 29th 08 09:07 PM
Worksheets -locked out of my own workbook. Rick M Excel Discussion (Misc queries) 1 October 13th 06 11:16 PM
Open A Locked Workbook cal_yeo Excel Worksheet Functions 5 July 4th 05 03:33 PM


All times are GMT +1. The time now is 02:54 AM.

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

About Us

"It's about Microsoft Excel"