How to detect / bypass the Workbook Recovery window and process

jjasmith4

Board Regular
Joined
Aug 22, 2018
Messages
59
I'm working with a Word/VBA system, and as it goes, it opens an XLSX to get some information from it. One of many users reported that nothing came from the XLSX, so I manually opened Excel to open the file which the code should have opened, just to prove it wasn't a permissions / access issue.

What happened was that, when I double-clicked the XLSX, Excel opened, and the Recovery window came up, the one that tells you about unsaved documents following an abnormal crash. No other user had that, so it worked fine for the rest. And once I dismissed all the recovered files, closed Excel, and re-ran my Word/VBA system, it worked.

So somehow the presence of unsaved stuff following a crash is what prevents VBA code from opening any workbook. How in VBA can I create a new Excel application object (OK, I can do that) and successfully open a workbook in it without that recovery stuff getting in its way?

Thanks in advance.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Not exactly an answer. My system is a Word DOCM. When it starts, it starts Excel by creating a new application object. So whatever the user has done in Excel has happened before my system even starts. So even before creating the object, how can I know Excel's recovery pane will come up and interfere?
 
Upvote 0
Thanks, Paul Ked, I saw that, and after reading through it, I don't like it. It seems really clumsy and unusual for regular users to put up with, and I think I'll hear about it from many of them.

I did find out about %LOCALAPPDATA%\Microsoft\Office\UnsavedFiles, so I'm going to give that a try...
 
Last edited:
Upvote 0
Will do, but feel free yourself! Next time Word, Excel or Powerpoint crashes, check out that folder
 
Upvote 0
Just a thought, what if you delete all temp files that start with a tilde before opening excel?
 
Upvote 0
Oh believe me, I know about cleaning Temp, Content.MSO, tilde files, ATF Cleaner, CCleaner, Disk Cleanup, all that. They clean files, but they don't preven the Recovery dialog...
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top