Solved

ThisWorkbook.Windows(1).Visible = False

Posted on 2013-06-04
4
723 Views
Last Modified: 2013-06-07
Hi,

I have a form named 'LoginFrm' in the workbook named 'Forecast.xlsm'. I have written the below code in workbook_open() event.

 Private Sub Workbook_Open()

ThisWorkbook.Windows(1).Visible = False
LoginFrm.Show

End Sub

Open in new window


This will disable the user to access the worksheets which are there in this workbook. However, if there are already workbooks open (i am referring to other workbooks) then when I open this workbook (Forecast.xlsm) then this code will disable the user in accessing other opened workbooks also. Ideally, the user should be able to access other workbooks other than 'Forecast.xlsm'. Please advise.

Thank you,
Prashanth
0
Comment
Question by:pg1533
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39221201
It might be because all the workbooks are in the same instance and share the same window.
EE's sister site online-tech-tips has a registry patch for creating multiple instances in this article:

http://www.online-tech-tips.com/ms-office-tips/how-to-open-a-new-instance-of-excel-2007-workbooks/

Or there is discussion in a recent question here:

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28070937.html
0
 
LVL 23

Expert Comment

by:Michael74
ID: 39221747
Instead of making the windows not visible why not set all tabs to xlVeryHidden and then once the user has logged on then loop through and make them visible. You would also add a before save script to hide them before the workbook is saved.

Michael
0
 
LVL 23

Accepted Solution

by:
Michael74 earned 500 total points
ID: 39221801
Here is an example of what you could do

Michael
Book1.xlsm
0
 

Author Closing Comment

by:pg1533
ID: 39230143
Thank you
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question