• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA to close Multiple Views

David Evans

Active Member
In my model I have several views of the Workbook - when i close out, I'd like to close down the multiple views, leaving just a single view.

What's the best way of doing it?
 
Hi Dave

What do you mean by 'views' of the workbook. One workbook - one view?

There is a big Red Cross in the top right of each spreadsheet. Give that a good old fashioned click. That will shut it down.

Take care

Smallman
 
Last edited:
Hi Dave

What do you mean by 'views' of the workbook. One workbook - one view?

There is a big Red tick in the top right of each spreadsheet. Give that a good old fashioned click. That will shut it down.

Take care

Smallman
I have one workbook with several views of it over multiple screens. After processing and prior to saving the file, I want to close the multiple views .... programmatically.

Thanks for replying!
 
Hi Dave

Are you saying you open multiple instances of Excel and you are placing the instances on each screen. Are you in some sort of trading environment? The environment I used to work in people had 6 screens in front of them.

Mmm I have only one screen and I guess if my assumption is correct you will need a procedure to close each instance of Excel except the one you are in.

I think possible.

Take care

Smallman
 
Hi Dave

Are you saying you open multiple instances of Excel and you are placing the instances on each screen. Are you in some sort of trading environment? The environment I used to work in people had 6 screens in front of them.

Mmm I have only one screen and I guess if my assumption is correct you will need a procedure to close each instance of Excel except the one you are in.

I think possible.

Take care

Smallman


I ended up using this snippet of code to close down the various views - it works a treat!

Thanks for your interest Smallman - collaboration is a great catalyst for results!


Code:
Sub CloseWin()
Dim wndw As Window

With ActiveWorkbook

Do Until .Windows.Count = 1

ActiveWindow.Close
Loop
End With
End Sub
 
Back
Top