Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Database Workbook
I have a Database workbook that is opened by other workbooks to access the
data in it. Is it possible to make the database workbook so that it can only be opened thru antoher workbook and not by clicking on the icon? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Database Workbook
You can do this with the Auto_Open procedure in the data base workbook.
Sub Auto_Open() MsgBox "This workbook cannot be opened manually" ThisWorkbook.Close savechanges:=False End Sub Auto_Open is automatically executed when the workbook is opened manually, not when it is opened via VBA code and so the code above closes the workbook if it is opened manually. Of course, the user could defeat this by disabling VBA code or by simply holding the SHIFT key down while opening the workbook. However, this approach may be "good enough" for your purposes. If you need code to run when the workbook is opened, either via VBA code and manually, put that code in the Workbook_Open event in the ThisWorkbook module. Workbook_Open is executed when the workbook is opened, regardless of how it is opened. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) "ranswrt" wrote in message ... I have a Database workbook that is opened by other workbooks to access the data in it. Is it possible to make the database workbook so that it can only be opened thru antoher workbook and not by clicking on the icon? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
include access database in excel workbook | Excel Programming | |||
How to use workbook is a database? | Excel Programming | |||
Creating an Excel Database in Separate Workbook | Excel Programming | |||
VLOOKUP in another workbook/Access database | Excel Programming | |||
Formatting a workbook for database import | Excel Programming |