Solved

ThisWorkbook.Windows(1).Visible = False

Posted on 2013-06-04
4
661 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article will show you how to use shortcut menus in the Access run-time environment.
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now