KenMcKenzie
New Member
- Joined
- Mar 14, 2018
- Messages
- 2
Hi. Apologies if I haven't got this right or if the thread exists -this is the first time I've posted.
I've set up some code to switch off that pesky Autorecover. Below is the code in PERSONAL.xlsb:ThisWorkbook:
This works fine when opening a workbook from within Excel. But if Excel isn't running and you double-click a file in Explorer, you get Runtime error '91' - variable not set.
I've tried various WAITs to allow Excel to open fully but doesn't make any difference.
Any suggestions would be appreciated.
KenMcKenzie
I've set up some code to switch off that pesky Autorecover. Below is the code in PERSONAL.xlsb:ThisWorkbook:
Code:
Public WithEvents App As Application
Private Sub Workbook_Open()
'runs once per Excel session when Personal.xlsb is opened
'Needed to make next sub work
Set App = Application
End Sub
Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
'This will run everytime a workbook is opened
If ActiveWorkbook.AutoSaveOn = True Then ActiveWorkbook.AutoSaveOn = False
End Sub
I've tried various WAITs to allow Excel to open fully but doesn't make any difference.
Any suggestions would be appreciated.
KenMcKenzie