Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default make workbook visible

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default make workbook visible

a loop like this would do it...just add it to the before close procedure



Dim wb As Workbook
For Each wb In Workbooks
Windows(wb.Name).Visible = True
Next






"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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default make workbook visible

Hi Patrick,
Tks for your prompt reply. Is that means I have to list all workbook names
before Next like this:

Windows(wb.book1).Visible = True
Windows(wb.book2).Visible = True
Windows(wb.book3).Visible = True
.....
Next
End Sub

Rgds
"Patrick Molloy" wrote:

a loop like this would do it...just add it to the before close procedure



Dim wb As Workbook
For Each wb In Workbooks
Windows(wb.Name).Visible = True
Next






"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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default make workbook visible

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default make workbook visible

How about the close books action ? where do I place the ActiveWorkbook.Close.

"Patrick Molloy" wrote:

a loop like this would do it...just add it to the before close procedure



Dim wb As Workbook
For Each wb In Workbooks
Windows(wb.Name).Visible = True
Next






"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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default make workbook visible

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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default make workbook visible

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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default make workbook visible

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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default make workbook visible

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

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default make workbook visible

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



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default make workbook visible

Jacob,
Yes, Workbooks.Open and ActiveWindow.Visible = False
Thats it.

p.s. I found said file was auto hide in window arrangement. I have to
release it, then all back to normal, rest files do not need this procedure.
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

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default make workbook visible


I'm not sure waht you mean. Is there any point in making the workbooks
visible if you're closing them anyway?
This code has an IF/END IF that closes all workbooks without saving except
the workbook runnign the code.

Dim wb As Workbook
For Each wb In Workbooks
Windows(wb.Name).Visible = True
if wb.Name < thisworkbook.Name then
wb.Close False
end if
Next




"Seeker" wrote:

How about the close books action ? where do I place the ActiveWorkbook.Close.

"Patrick Molloy" wrote:

a loop like this would do it...just add it to the before close procedure



Dim wb As Workbook
For Each wb In Workbooks
Windows(wb.Name).Visible = True
Next






"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

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default make workbook visible

no, its a loop, so wb.Name will be 'book1' say in the first iteration, then
it will change to 'book2' in the next iteration.. Essentially Workbooks is a
collection of workbooks in the curent excel session and iterating FOR EACH wb
will assign each workbook to the variable wb for each iteration


"Seeker" wrote:

Hi Patrick,
Tks for your prompt reply. Is that means I have to list all workbook names
before Next like this:

Windows(wb.book1).Visible = True
Windows(wb.book2).Visible = True
Windows(wb.book3).Visible = True
....
Next
End Sub

Rgds
"Patrick Molloy" wrote:

a loop like this would do it...just add it to the before close procedure



Dim wb As Workbook
For Each wb In Workbooks
Windows(wb.Name).Visible = True
Next






"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

  #14   Report Post  
Posted to microsoft.public.excel.programming
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

  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default make workbook visible

Hi Jacob,
I found the trick.
Since the file still hide in the window as invisible no matter when it is
opened by macro or manually, Firstly I opened it manually(it is invisible),
then unhide it from window, then file show up on window as visible, I saved,
closed, then the file back to normal. So now I can open this file manully
from directory path and able to alter contents. Thanks again for your help
and my problem is solved now.
Regards

"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



  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default make workbook visible

Hi Patrick,
Thanks for your code. However, with help from Jacob, my problem is solved now.
Thanks again.
Regards

"Patrick Molloy" wrote:


I'm not sure waht you mean. Is there any point in making the workbooks
visible if you're closing them anyway?
This code has an IF/END IF that closes all workbooks without saving except
the workbook runnign the code.

Dim wb As Workbook
For Each wb In Workbooks
Windows(wb.Name).Visible = True
if wb.Name < thisworkbook.Name then
wb.Close False
end if
Next




"Seeker" wrote:

How about the close books action ? where do I place the ActiveWorkbook.Close.

"Patrick Molloy" wrote:

a loop like this would do it...just add it to the before close procedure



Dim wb As Workbook
For Each wb In Workbooks
Windows(wb.Name).Visible = True
Next






"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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make the cell to be visible Andrei Zakharov Excel Programming 2 August 27th 08 01:54 PM
I need to make MS word visible..please help Steven Excel Programming 4 October 19th 05 05:44 PM
make outlook visible gopher Excel Programming 5 January 5th 05 06:15 PM
make hidden window or workbook visible without specify the name mango Excel Worksheet Functions 1 December 30th 04 03:05 PM
Code to make sheets in a workbook visible Jonsson[_4_] Excel Programming 5 January 30th 04 12:38 PM


All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"