How to detect / bypass the Workbook Recovery window and process

jjasmith4

New Member
Joined
Aug 22, 2018
Messages
48
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.
 

NdNoviceHlp

Well-known Member
Joined
Nov 9, 2002
Messages
2,348
Add some error code so that when XL errors it doesn't crash. HTH. Dave
 

jjasmith4

New Member
Joined
Aug 22, 2018
Messages
48
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?
 

jjasmith4

New Member
Joined
Aug 22, 2018
Messages
48
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:

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
442
Good luck, I'll keep an eye on this thread if you'd be kind enough to update. (y)
 

jjasmith4

New Member
Joined
Aug 22, 2018
Messages
48
Will do, but feel free yourself! Next time Word, Excel or Powerpoint crashes, check out that folder
 

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
442
Just a thought, what if you delete all temp files that start with a tilde before opening excel?
 

jjasmith4

New Member
Joined
Aug 22, 2018
Messages
48
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...
 

Forum statistics

Threads
1,082,259
Messages
5,364,099
Members
400,779
Latest member
lumers

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top