Results 1 to 4 of 4

Thread: Solved: How to open sheets as hidden

  1. #1

    Solved: How to open sheets as hidden

    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

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Jun 2004
    Tulsa, Oklahoma
    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.
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3


    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

  4. #4

    found solution

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts