Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 504
Default VB code to tell if my sheet is read-only

Hi

I want to run code only if the workbook is live (ie not read-only). I have
set the workbook to advise users to open it read only but If they choose to
open edit then I want to force a close after 2 hours ( I have the code for
this).

is this very simple?
--
Kevin
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 367
Default VB code to tell if my sheet is read-only

Hi Kevin

Try this:

Private Sub Workbook_Open()

If Not ActiveWorkbook.ReadOnly Then
'your code to close the book in 2 hrs
End If

End Sub

hth

Carlo


On Jan 10, 8:59*am, Kevin wrote:
Hi

I want to run code only if the workbook is live (ie not read-only). I have
set the workbook to advise users to open it read only but If they choose to
open edit then I want to force a close after 2 hours ( I have the code for
this).

is this very simple?
--
Kevin


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
VBA code to read formular from another cell fLiPMoD£ Excel Discussion (Misc queries) 1 April 25th 07 12:12 AM
create a formula in one sheet that would read data from separate sheet automatically QD Excel Discussion (Misc queries) 0 December 8th 06 04:17 AM
How do I read this VBA code? [email protected] Excel Discussion (Misc queries) 1 November 21st 06 08:44 PM
Need VBA Code to Open a Workbook in read only zulfer7 Excel Discussion (Misc queries) 1 July 10th 06 11:00 PM
how read data downloaded on cd-rw, now show only code? turbobucs New Users to Excel 2 April 1st 05 03:23 PM


All times are GMT +1. The time now is 12:25 AM.

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"