Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make the cell to be visible | Excel Programming | |||
I need to make MS word visible..please help | Excel Programming | |||
make outlook visible | Excel Programming | |||
make hidden window or workbook visible without specify the name | Excel Worksheet Functions | |||
Code to make sheets in a workbook visible | Excel Programming |