Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Avoid to reopen a working Workbook

I have a program developed in VBA over EXCEL which does not have t
allow to open another session of itself, that is, if a user opens th
book that contains the program, and once opened, he or she (the user
tries to open the same book again, first of them (first sessio
Workbook) does not have to allow to open the second one, all thi
without disturbing the normal EXCEL operation with other EXCE
workbooks.

In other words, I want to allow the User to open the Workbook
financial.xls only once at a time. (avoid reopen)

Another explanation:

How do I restrict the user to open a workbook only one time until it i
closed?

Thanks

Marcelo

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Avoid to reopen a working Workbook

Marcelo,

I'm not entirely clear what your question is. Excel
automatically prevents the user from opening the same workbook
twice (Excel can't have two files with the same name open).


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Marcelo " wrote in
message ...
I have a program developed in VBA over EXCEL which does not

have to
allow to open another session of itself, that is, if a user

opens the
book that contains the program, and once opened, he or she (the

user)
tries to open the same book again, first of them (first session
Workbook) does not have to allow to open the second one, all

this
without disturbing the normal EXCEL operation with other EXCEL
workbooks.

In other words, I want to allow the User to open the Workbook:
financial.xls only once at a time. (avoid reopen)

Another explanation:

How do I restrict the user to open a workbook only one time

until it is
closed?

Thanks

Marcelo.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Avoid to reopen a working Workbook

Try thie:

Put a code in a WB and open it using the "recently opened files
shortcut list at the bottom of the File menu.

Something like this:
Private Sub Workbook_Open()
MsgBox IIf(Me.ReadOnly, "Hi, I'm ReadOnly", "Good Morning")
End Sub

Open this using File | Open, the macro does execute a 2nd time.

I would like to avoid that.

I want to avoid too the message taht arise when you try to open th
opened workbook again : "TestBook.xls is alredy open. If you continu
your data will be lost." or something like that (my Excel is i
Spanish).

Let me try to explain how my software works: I open my workbook,
main UserForm appear with Excel Minimized and Invisibl
(Excel.Application.Visible = False).
At this point, if the user try to run a new session of this workboo
the message above appear and let the user choose yes or not ( rerunnin
the workbook damaging the data on the sheets worked by the user at thi
time). I want is to avoid this, In other words, When the user try t
run a new session of the workbook, nothing happend and the origina
session remain intact.

Thanks a lot.

Marcel

--
Message posted from http://www.ExcelForum.com

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
Reopen workbook Weeepie Excel Discussion (Misc queries) 6 November 14th 07 04:56 PM
How to avoid opening an empty workbook every time I open a file? Nick Papadakis Setting up and Configuration of Excel 2 February 12th 06 11:55 AM
how to avoid duplicates in excel workbook? smart Excel Discussion (Misc queries) 1 January 10th 05 02:42 PM
Avoid Deleting a Shared Workbook using VBA gr8guy Excel Programming 0 May 6th 04 08:25 AM
When workbook is closed tries to reopen?? bdcrisp[_2_] Excel Programming 3 December 8th 03 05:42 PM


All times are GMT +1. The time now is 03:29 PM.

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"