View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Seeker Seeker is offline
external usenet poster
 
Posts: 137
Default make workbook visible

Jacob,
What I mean is file now opened as invisible, I have to go to Window -
Unhide before I can manipulate it.
Rgds

"Jacob Skaria" wrote:

Do you have any other code getting executed during Workbook Open event..

If this post helps click Yes
---------------
Jacob Skaria


"Seeker" wrote:

Hi Jacob,
I have two master files both has macro to open other files for data
extraction. One of the file (say workbook 3)is sharing by these two master
files. After your code placed to Workbook_BeforeClose, and ran both master
files' macro, I supose all opened invisible files should be restored as
normall visible files and be closed. I tried to open all files that had been
called by these two master files and able to open them normally. Only for
this workbook 3 is still invisible. Excel showing the opeing file scale at
the bottom when opening workbook3, but I cannot see anything after excel
finished open.


"Jacob Skaria" wrote:

I didnt get you..Try opening those workbooks again manually..

If this post helps click Yes
---------------
Jacob Skaria


"Seeker" wrote:

Hi Jacob,
The closed workbooks still invisible?
Rgds

"Jacob Skaria" wrote:

The code is to be placed within the BeforeClose event of your workbook.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim wb As Workbook
For Each wb In Workbooks
If wb.Name < ThisWorkbook.Name Then wb.Close False
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Try the below

Dim wb As Workbook
For Each wb In Workbooks
If wb.Name < ThisWorkbook.Name Then wb.Close False
Next

If this post helps click Yes
---------------
Jacob Skaria


"Seeker" wrote:

Dear All,
Some files are opened under ActiveWindow.Visible = False when a master file
opened, a small code is needed to be placed in the Workbook_BeforeClose to
check if any invisible file(s) still open, if yes, make invisible file(s) be
visible and close file(s). A thread has mentioned by using
Windows(€śfile.xls€ť).Visible = True, how should I do that please?
Regards