Solved

ThisWorkbook.Windows(1).Visible = False

Posted on 2013-06-04
4
746 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:Michael Fowler
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:
Michael Fowler 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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 demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

688 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