Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Programmatically determining if workbook is opened as Read Only

I have a data extraction macro that I run monthly and it takes a while to
run, so I periodically open it in another Excel instance as Read Only during
the extraction to get an indication on how much is left to extract.
Unfortunately, I also have a workbook open event that asks if I want to run
the macro, which fires whether it's read only or not. I don't want this
message displayed if the workbook is opened as read only. Is there some way
to do that?

Thanks,
Barb Reinhardt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Programmatically determining if workbook is opened as Read Only

I found what I need. It's ActiveWorkbook.ReadOnly. Now why didn't I think
of that before I posted this? :)

Thanks anyway!
Barb Reinhardt



"Barb Reinhardt" wrote:

I have a data extraction macro that I run monthly and it takes a while to
run, so I periodically open it in another Excel instance as Read Only during
the extraction to get an indication on how much is left to extract.
Unfortunately, I also have a workbook open event that asks if I want to run
the macro, which fires whether it's read only or not. I don't want this
message displayed if the workbook is opened as read only. Is there some way
to do that?

Thanks,
Barb Reinhardt

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Programmatically determining if workbook is opened as Read Only

Seems to work OK

Private Sub Workbook_Open()
If ThisWorkbook.ReadOnly = True Then
MsgBox "This book is read only."
Else
MsgBox "Run"
'run your macro
End If
End Sub

Mike

"Barb Reinhardt" wrote:

I have a data extraction macro that I run monthly and it takes a while to
run, so I periodically open it in another Excel instance as Read Only during
the extraction to get an indication on how much is left to extract.
Unfortunately, I also have a workbook open event that asks if I want to run
the macro, which fires whether it's read only or not. I don't want this
message displayed if the workbook is opened as read only. Is there some way
to do that?

Thanks,
Barb Reinhardt

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Programmatically determining if workbook is opened as Read Onl

Why not hold down the shift key while you open the workbook.

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

I found what I need. It's ActiveWorkbook.ReadOnly. Now why didn't I think
of that before I posted this? :)

Thanks anyway!
Barb Reinhardt



"Barb Reinhardt" wrote:

I have a data extraction macro that I run monthly and it takes a while to
run, so I periodically open it in another Excel instance as Read Only during
the extraction to get an indication on how much is left to extract.
Unfortunately, I also have a workbook open event that asks if I want to run
the macro, which fires whether it's read only or not. I don't want this
message displayed if the workbook is opened as read only. Is there some way
to do that?

Thanks,
Barb Reinhardt

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Programmatically determining if workbook is opened as Read Onl

Tom,

Does it work that way when I open a new Excel instance and open the workbook
from the list of last edited files?

Thanks,
Barb Reinhardt



"Tom Ogilvy" wrote:

Why not hold down the shift key while you open the workbook.

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

I found what I need. It's ActiveWorkbook.ReadOnly. Now why didn't I think
of that before I posted this? :)

Thanks anyway!
Barb Reinhardt



"Barb Reinhardt" wrote:

I have a data extraction macro that I run monthly and it takes a while to
run, so I periodically open it in another Excel instance as Read Only during
the extraction to get an indication on how much is left to extract.
Unfortunately, I also have a workbook open event that asks if I want to run
the macro, which fires whether it's read only or not. I don't want this
message displayed if the workbook is opened as read only. Is there some way
to do that?

Thanks,
Barb Reinhardt



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Programmatically determining if workbook is opened as Read Onl

Yes. Once you have the mouse over the filename, hold down the shift key
until it has opened.

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

Tom,

Does it work that way when I open a new Excel instance and open the workbook
from the list of last edited files?

Thanks,
Barb Reinhardt



"Tom Ogilvy" wrote:

Why not hold down the shift key while you open the workbook.

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

I found what I need. It's ActiveWorkbook.ReadOnly. Now why didn't I think
of that before I posted this? :)

Thanks anyway!
Barb Reinhardt



"Barb Reinhardt" wrote:

I have a data extraction macro that I run monthly and it takes a while to
run, so I periodically open it in another Excel instance as Read Only during
the extraction to get an indication on how much is left to extract.
Unfortunately, I also have a workbook open event that asks if I want to run
the macro, which fires whether it's read only or not. I don't want this
message displayed if the workbook is opened as read only. Is there some way
to do that?

Thanks,
Barb Reinhardt

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
Hide Custom Command Bar if Workbook opened Read-Only [email protected] Excel Programming 2 April 28th 08 06:55 PM
Programmatically determining if worksheet is protected Barb Reinhardt Excel Programming 2 November 9th 06 06:58 PM
stop excel file opened as read only if already opened by another u bobm Excel Programming 3 August 5th 05 04:11 PM
Determining if workbook is already opened by someone else? Don Wiss Excel Programming 1 May 28th 05 11:40 AM
How to read sheet of currently opened workbook Jedi[_2_] Excel Programming 1 September 11th 03 11:00 AM


All times are GMT +1. The time now is 04:51 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"