I have an Outlook function that, as of Friday the 3rd May 2019 has started throwing the following error:
Run-time error '-2147417851 (80010105)':
Method 'Open' of object "Workbooks' failed
This is the code up to the error point:
Sub CreateDictionary()
Dim start
Dim finish
start = Timer
Dim path As String
'***---Declarations---***
Dim MyEmail As Object
Dim xl As New Excel.Application
Dim wb As Excel.Workbook
Dim Sheet As Excel.Worksheet
Dim ExcelFileName As String
Dim j As Integer
Dim jMax As Variant
Dim entry As String
'***---Set Required Variables---***
ExcelFileName = "\\HYPER\CURRENT JOBS\USEFUL STUFF\Active Jobs DB.xlsm"
Set wb = xl.Workbooks.Open(ExcelFileName, 0, True)
I have checked the filename and it is fine. I have double checked my entries in the xl.Workbooks.Open
command and nothing changes. I have read elsewhere that this is a Windows 10 issue, though I could not find any guidance to fixing the issue.
Has anyone here had a similar problem?
EDIT: I have created a temporary workaround by opening the required workbook and using the following code:
On Error Resume Next
Set wb = GetObject("\\HYPER\CURRENT JOBS\USEFUL STUFF\Active Jobs DB.xlsm")
If Err <> 0 Then
MsgBox ("Please open Active Jobs Database and try again")
Exit Sub
End If
On Error GoTo 0
It is currently working but it is obviously not as streamlined as my previous code. If anyone can find out why this is happening, I would greatly appreciate it!