title: 1004 Read-Only Error when Opening Closed Workbooks in VBA
body: <p>To give context to the problem that I'm facing - keep in mind I'm a relative novice - I am attempting to write a code that will open and then close a series of workbooks all contained within a folder, ultimately in order to update a number of VLookups on the master data sheet (since to update them, I believe the dependents need to be open).</p>
  
  <p>Right now, I'm simply attempting to do this for one of the files which I can then go through and do for the rest of the folder. When I do attempt to open the file though, I get the "Run-Time Error 1004" with the message "Excel cannot access 'FolderName'. The document may be read-only or encrypted"</p>
  
  <p>The code I'm using is:</p>
  
  <pre><code>sub openevery_v2()
  ' openevery_v2 Macro
  ' Keyboard Shortcut: Ctrl+Shift+O
  
  ' Dim diaFolder As FileDialog &lt;-- Ideally the user would use a dialog box to select the folder
  ' Dim Fname As String
  ' Dim originalWB As Workbook
  ' Set originalWB = ThisWorkbook
  ' originalWB.Save
  ' Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)
  ' diaFolder.AllowMultiSelect = False
  ' diaFolder.Show
  ' Fname = diaFolder.SelectedItems(1)
  
  Fname = "C:\FolderPath"
  Openr = Dir(Fname + "Filename.xlsm")
  Workbooks.Open (Fname)
  
  End Sub
  </code></pre>
  
  <p>I've tried to change the settings of the folder from non-read only, but I don't think that is the issue at hand. </p>
  
  <p>Has anyone run through a similar issue or can think of a solution to this particular issue? Alternatively, if there is a better way to think through this challenge, that would be much appreciated.</p>