Home

Force a view on open?

%3CLINGO-SUB%20id%3D%22lingo-sub-903250%22%20slang%3D%22en-US%22%3EForce%20a%20view%20on%20open%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-903250%22%20slang%3D%22en-US%22%3E%3CP%3EI%20know%20we%20can%20set%20a%20default%20view%20for%20%3CEM%3Enew%3C%2FEM%3E%20documents%2C%20but%20can%20we%20force%20existing%20documents%20to%20open%20in%20our%20preferred%20view%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20use%20a%20lot%20of%20shared%20documents%2C%20and%20it's%20a%20real%20pain%20to%20have%20to%20constantly%20change%20the%20view%20every%20time%20a%20document%20is%20opened...every%20click%20matters.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIdeas%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-903250%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20Desktop%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENeed%20Help%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-907029%22%20slang%3D%22en-US%22%3ERe%3A%20Force%20a%20view%20on%20open%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-907029%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F423093%22%20target%3D%22_blank%22%3E%40Heelertreats%3C%2FA%3E%26nbsp%3BYou%20can%20use%20a%20%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fcreate-apply-or-delete-a-custom-view-ce722bf9-0b4a-49a5-94ba-438fde18fc2b%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECustom%20View%3C%2FA%3E%2C%20then%20call%20it%20from%20the%20Workbook_Open%20event%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EPrivate%20Sub%20Workbook_Open()%0A%20%20%20ActiveWorkbook.CustomViews(%22new%22).Show%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlternatively%2C%20record%20a%20macro%20setting%20the%20view%20options%20you%20want%2C%20and%20call%20that%20from%20the%20Open%20event.%20Feel%20free%20to%20post%20back%20the%20resulting%20code%20here%2C%20and%20someone%20can%20clean%20it%20up%20for%20you.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHTH%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-908446%22%20slang%3D%22en-US%22%3ERe%3A%20Force%20a%20view%20on%20open%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-908446%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F10827%22%20target%3D%22_blank%22%3E%40Smitty%20Smith%3C%2FA%3E!%3C%2FP%3E%3CP%3EI%20don't%20have%20a%20lot%20of%20experience%20with%20VBA%2C%20so%20I%20have%20followups.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20issue%20is%20that%20I%20go%20to%20the%20server%20and%20open%2C%20say%2C%20%22doc1%22%2C%20and%20to%20my%20endless%20irritation%20it's%20in%20page%20break%20and%20zoomed%20out%20to%2030%25%20because%20that's%20how%20the%20last%20user%20saved%20it.%20And%20each%20TAB%20will%20be%20variously%20displayed%20depending%20on%20how%20the%20last%20user%20saved%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20the%20VBA%20you've%20provided%20a%20%22global%22%20command%20I%20can%20set%20for%20my%20local%20instance%20of%20Excel%20that%20would%20apply%20to%20all%20documents%20I%20open%2C%20or%20is%20it%20something%20I'd%20need%20to%20code%20in%20each%20document%20separately%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20seems%20like%20a%20perfect%20solution%20if%20I%20can%20do%20it%20to%20my%20local%20instance%20and%20be%20done%20with%20it%2C%20but%20if%20I%20need%20to%20touch%20hundreds%20of%20documents%20(and%20leave%20them%20permanently%20changed)%20I'd%20have%20to%20just%20deal%20with%20the%20status%20quo.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThoughts%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Heelertreats
New 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?

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies