Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 07-03-2023, 12:20 AM
StuW StuW is offline PW protected XLSX won't open maximized Windows 10 PW protected XLSX won't open maximized Office 2010
Novice
 
Join Date: Jul 2023
Posts: 1
StuW is on a distinguished road
Default RE: Password protected XLSX won't open maximized

Old thread now, but here is how I fixed this.
Note that this is not elegant! And purely based on my observations, not rigorous analysis.

Background:
There appears to be a bug in Excel 2010 (and likely later versions) when opening password protected files. Something about the on-open password popup box seems to result in Excel defaulting to a non-maximised size, regardless of whether you configure Run=Maximised in the Excel shortcut. Note that if Excel is already open and maximised prior to opening the password-ed file, then it stays maximised ok.

Solution.
Note: Please google concepts below (eg 'Personal.xlsb') if you don't know how they work.

I have seen posts stating the solution is to add VBA code to Personal.xlsb, executed when any workbook is opened. This code triggers off the 'Workbook_Open' event to force the window to maximised. Unfortunately I found this did not work for password protected files. The 'Workbook_Open' event appears to occur BEFORE the worksheet password popup, and it looks like the popup is somehow overriding any prior attempt to maximise the workbook.

After a little playing around, I found a workaround that works for me. The VBA 'Application.OnTime' function can be added to defer the above maximisation for a second, which seems to be enough to place it AFTER whatever the password popup box is doing. As a result Excel is maximised immediately after a password is entered. Yes, this doesnt 100% make sense, but worked when nothing else would!

Within Personal.xlsb:
1) Add the following VBA under "MicrosoftExcelObjects / ThisWorkbook"

Private Sub Workbook_Open()
Application.OnTime (Now() + TimeValue("00:00:01")), "MaximiseExcel"
'1 second delay seems to be enough. Try a little more if this doesnt work reliably.
End Sub

2) Create a new module under "Modules" with the following:

Sub MaximiseExcel()
Application.WindowState = xlMaximized
End Sub
Reply With Quote
 

Tags
openmaximized, password, protected



Similar Threads
Thread Thread Starter Forum Replies Last Post
Office Compatibility Pack - will not open xlsx Meeker Excel 6 02-20-2022 12:11 AM
PW protected XLSX won't open maximized Cannot open emailed documents in Word 2010 - Protected View Andrewjmarino Word 8 09-05-2013 03:58 PM
Open xlsx and doxc at the same time marco24 Office 2 03-15-2013 07:26 AM
How to open a password-protected word document? navalava Word 1 07-01-2012 12:15 PM
PW protected XLSX won't open maximized Excel won't open maximized from URL jdanton Excel 2 09-24-2009 08:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft