Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Disable the opening of another workbook

Dear all, I just would like to know how could I prevent the opening of second workbook while the first workbook is opened or in using. Great thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Disable the opening of another workbook

Hi DDLY;

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnWindow = ""
End Sub

Private Sub Workbook_Open()
Application.OnWindow = ThisWorkbook.Name & "!ThisWbkOnly"
End Sub

In a standard module:
Sub ThisWbkOnly()
If Not ActiveWorkbook.Name = ThisWorkbook.Name Then
ActiveWorkbook.Close False
MsgBox "This session of Excel is reserved for the " & ThisWorkbook.Name
& " !"
End If
End Sub

MP

"DDLY" a écrit dans le message de
...
Dear all, I just would like to know how could I prevent the opening of
second workbook while the first workbook is opened or in using. Great
thanks!


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
How do I stop blank workbook from opening when opening an existing kjg Excel Discussion (Misc queries) 3 February 12th 10 09:36 PM
How to disable General formatting when opening CSV Cory_Jackson Excel Discussion (Misc queries) 1 February 25th 09 01:05 AM
how to disable always ask before opening this type of file jmauldin Excel Discussion (Misc queries) 2 August 8th 08 08:40 PM
Disable macros on a programmatically opening .xls file Matt[_2_] Excel Discussion (Misc queries) 2 May 25th 07 04:45 AM
disable menus on opening Excel Dave[_17_] Excel Programming 0 July 16th 03 11:23 PM


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