ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Keeping a workbook hidden when opened via VBA??? (https://www.excelbanter.com/excel-programming/312647-keeping-workbook-hidden-when-opened-via-vba.html)

Simon Lloyd[_585_]

Keeping a workbook hidden when opened via VBA???
 

Hi all,

Does anyone know how to keep a workbook hidden that is opened via VB
and visible when opened normally i.e with a double left click or fro
choosing File and then Open??


Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=26681


Geof Wyght[_2_]

Keeping a workbook hidden when opened via VBA???
 
Have a look the Caller property in help. If the Caller
is "An Auto_Open, Auto_Close, Auto_Activate, or
Auto_Deactivate macro" you could make the
activewindow.visible property false.
Geof.
-----Original Message-----

Hi all,

Does anyone know how to keep a workbook hidden that is

opened via VBA
and visible when opened normally i.e with a double left

click or from
choosing File and then Open??


Simon


--
Simon Lloyd
----------------------------------------------------------

--------------
Simon Lloyd's Profile:

http://www.excelforum.com/member.php?
action=getinfo&userid=6708
View this thread:

http://www.excelforum.com/showthread...hreadid=266818

.


CB Hamlyn

Keeping a workbook hidden when opened via VBA???
 
In the VBA that opens the workbook, simply hide it with:
---------------------------------------------------------
ActiveWindow.Visible = False
or
Windows("WorkbookName.xls").Visible = False
---------------------------------------------------------

Then, in the now hidden workbook's close code, do this:
-------------------------------------------------------------
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Windows("WorkbookName.xls").Visible = True
End Sub
-------------------------------------------------------------

Good Luck
CB Hamlyn

"Simon Lloyd" wrote in message
...

Hi all,

Does anyone know how to keep a workbook hidden that is opened via VBA
and visible when opened normally i.e with a double left click or from
choosing File and then Open??


Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile:
http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=266818




Tom Ogilvy

Keeping a workbook hidden when opened via VBA???
 
If you open it in VBA, then hide it with the same code. If you don't save
it, then it should be visible next time it is opened.



--
Regards,
Tom Ogilvy

"Simon Lloyd" wrote in message
...

Hi all,

Does anyone know how to keep a workbook hidden that is opened via VBA
and visible when opened normally i.e with a double left click or from
choosing File and then Open??


Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile:

http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=266818





All times are GMT +1. The time now is 07:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com