title: Word VBA macro errors opening files when run on some computers but not others?
body: <p>This has been a thorn in my side for months. It happens off and on for a small (but growing) number of users at my company, but not others running the same exact Word VBA Macro. The users get &quot;5097:Word encountered an issue&quot; or &quot;4605: Command failed&quot; runtime errors on lines of the code that open word or txt files. All are running the same build of windows and have the same permissions (according to the tech team.) The files are on a shared network drive.</p>
  <pre><code>Public Function readData(datafile As String) As String
  
      'datafile = &quot;\\network\unc\path\folder\folder\data.txt&quot;
      'I have confirmed this passes to the function correctly.
  
      Dim db As Document
      'Before it is suggested, I've tried early-binding, late-binding, and 
      'diming as Variant, Object, etc. to no effect
  
      'Errors on this line 
      Set db = Documents.OpenNoRepairDialog(fileName:=datafile, ConfirmConversions:=False, _
      ReadOnly:=True, Visible:=False) 
      'I have tried Documents.Open to no avail, in addition to toggling all of the parameters to
      'or removing parameters see if I would get a different result.
      'I have tried declaring the Word.Application and Application objects and prepending that 
      'to the function. Nadda. I also tried just the function, without setting as an object. No dice.
  
  
      '---rest of code---'
  
  End Function
  
  </code></pre>
  <p>I've used Debug.Print to check the file path was passed to the function correctly--it is.   Also this issue does not have to do with the file being a txt file. If I comment out this function in the main sub, I get the same error on the next function that attempts to open a word doc.
  Again, this exact macro runs flawlessly on some workstations.</p>
  <p>Here's the real kicker:
  The users are all able to navigate to the file paths the macro is trying to open in File Explorer without problem. When I run the &quot;Documents.Open(datafile)&quot; or &quot;Dir(datafile)&quot; functions in the immediate window they work perfectly, no issue. What gives?</p>