Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to prevent windows explorer from opening another workbook when
one workbook is already open? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is work fine for me
NOTE that you open workbook only from same computer: place this code inside Thisworkbook module: Dim OpenTimes Private Sub Workbook_BeforeClose(Cancel As Boolean) SaveSetting "APPTEST", "SETTING", "OPENTIMES", "0" End Sub Private Sub Workbook_Open() OpenTimes = GetSetting("APPTEST", "SETTING", "OPENTIMES") If OpenTimes = "1" Then Me.Close Else SaveSetting "APPTEST", "SETTING", "OPENTIMES", "1" End if End Sub -- Regards, Halim "joeeng" wrote: Is there a way to prevent windows explorer from opening another workbook when one workbook is already open? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the response Halim. However, that is not quite what I had in
mind. If one workbook is open, I wanted that workbook to prevent any other workbooks from being opened. Your code would have to be present in every workbook. I have figured out how to accomplish this by utilizing the application level events. joeeng "Halim" wrote: This is work fine for me NOTE that you open workbook only from same computer: place this code inside Thisworkbook module: Dim OpenTimes Private Sub Workbook_BeforeClose(Cancel As Boolean) SaveSetting "APPTEST", "SETTING", "OPENTIMES", "0" End Sub Private Sub Workbook_Open() OpenTimes = GetSetting("APPTEST", "SETTING", "OPENTIMES") If OpenTimes = "1" Then Me.Close Else SaveSetting "APPTEST", "SETTING", "OPENTIMES", "1" End if End Sub -- Regards, Halim "joeeng" wrote: Is there a way to prevent windows explorer from opening another workbook when one workbook is already open? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
prevent workbook opening if already open by someone else | Excel Discussion (Misc queries) | |||
Prevent two network users from opening same workbook? | Excel Programming | |||
How can I prevent calculations upon opening workbook? | Excel Programming | |||
Prevent worksheet from opening in a workbook | Excel Worksheet Functions | |||
How to prevent any one from opening my workbook | New Users to Excel |