PDA

View Full Version : Solved: How to open sheets as hidden



paolo2504
04-28-2010, 02:59 AM
hi all,
i have a procedure which creates new workbooks, process them, finally save&close. Even if i use application.screenupdating = false i see the 'file open'....'file close' in the windows bar below.
The procedure is processing hundreds files so i see this 'file flashing' in the windows bar so many times...
Anybody know how to 'hide-on-open' files ? I found the following piece of code but i'm not sure it works...


Workbooks.Open ('myfile').application.visible = false
ActiveWindow.Visible = False
Workbooks.Application.Visible = False
............

lucas
04-28-2010, 07:08 AM
Without any more information than you have been willing to share, ie an example with everything out except the create files, save and close part, It would be hard to diagnose.

did you try:

Application.EnableEvents = False

be sure to reset it to true at the end of the procedure.

paolo2504
04-30-2010, 06:09 AM
thanks Lucas for reply.
Maybe i was too quick in my post: there's no issue in my code i just wish o understand if it is possible to hide opening of workbook.
I explain better.
I already use application.enableevents=false and application.screenupdating=false.
This is working fine.
At a certain point of the execution i start a loop where i :

start create new workbook
- put in it values
- build pivot table
- do calculation
- save&close the workbook
end zip it & continue to the next one

Everything between start / end is not shown due to screenupdating=false.
The only 'event' i see is inside Windows bar at the bottom of the screen where open/close of the new workbook is seen for all duration of the processing.
Thats all. I want to 'open-as-not-visible' the new workbook (where not visibile means i dont want to see it in the Windows bar).
hope this clarify

paolo2504
05-03-2010, 01:26 AM
i found that Workbooks.Application.Visible = False set just before the start of the loop completely hides opening/closing of workbooks.
Before closing procedure i enable it again with Workbooks.Application.Visible = True.

thank.