Force a view on open?

Copper Contributor

I know we can set a default view for new documents, but can we force existing documents to open in our preferred view?

 

We use a lot of shared documents, and it's a real pain to have to constantly change the view every time a document is opened...every click matters.

 

Ideas?

2 Replies

@Heelertreats You can use a Custom View, then call it from the Workbook_Open event:

 

Private Sub Workbook_Open()
   ActiveWorkbook.CustomViews("new").Show
End Sub

 

Alternatively, record a macro setting the view options you want, and call that from the Open event. Feel free to post back the resulting code here, and someone can clean it up for you.

 

HTH

 

Thank you @Smitty Smith!

I don't have a lot of experience with VBA, so I have followups.

 

The issue is that I go to the server and open, say, "doc1", and to my endless irritation it's in page break and zoomed out to 30% because that's how the last user saved it. And each TAB will be variously displayed depending on how the last user saved it.

 

Is the VBA you've provided a "global" command I can set for my local instance of Excel that would apply to all documents I open, or is it something I'd need to code in each document separately?

 

This seems like a perfect solution if I can do it to my local instance and be done with it, but if I need to touch hundreds of documents (and leave them permanently changed) I'd have to just deal with the status quo.

 

Thoughts?