title: VBA Copy data from an unopened CSV file to worksheet without opening closed CSV
body: <p>I believe I have a unique problem as I have not seen anything like it anywhere on the Internet.</p>
  
  <p>I am a business analyst/application developer and I want to automatically gather the data from other user's Excel CSV file on their personal computer without opening the file and disrupting them. Is there a way?</p>
  
  <p>Here is the code I have so far:</p>
  
  <pre><code>Option Explicit
  
  Dim MyDocuments As String, strFileName, myToday, origWorkbook, origWorksheet, strConnection
  Dim row As Integer
  
  Private Sub btnStart_Click()
      MyDocuments = Environ$("USERPROFILE") &amp; "\My Documents"
      myToday = Format(Date, "mmddyy")
      strFileName = "DataFile" &amp; myToday &amp; ".csv"
      strConnection = "TEXT;" &amp; MyDocuments &amp; "\DataFolder\" &amp; strFileName
      origWorksheet = "DataFile" &amp; myToday
  
      row = 1
      On Error Resume Next
      row = Range("A1").End(xlDown).row + 1
  
      With ActiveSheet.QueryTables.Add(Connection:=strConnection, Destination:=Range("$A$" &amp; row))
          .Name = "temp"
          .FieldNames = True
          .RowNumbers = False
          .FillAdjacentFormulas = False
          .PreserveFormatting = True
          .RefreshOnFileOpen = False
          .RefreshStyle = xlInsertDeleteCells
          .SavePassword = False
          .SaveData = True
          .AdjustColumnWidth = True
          .RefreshPeriod = 0
          .TextFilePromptOnRefresh = False
          .TextFilePlatform = 437
          .TextFileStartRow = 1
          .TextFileParseType = xlDelimited
          .TextFileTextQualifier = xlTextQualifierDoubleQuote
          .TextFileConsecutiveDelimiter = False
          .TextFileTabDelimiter = False
          .TextFileSemicolonDelimiter = False
          .TextFileCommaDelimiter = True
          .TextFileSpaceDelimiter = False
          .TextFileColumnDataTypes = Array(1)
          .TextFileTrailingMinusNumbers = True
          .Refresh BackgroundQuery:=False
      End With
  End Sub
  </code></pre>
  
  <p>Like I said, I don't want the CSV file to open while they are working. I would like this behind the scenes so they can keep working while we gather the data.</p>
  
  <p>I'm guessing my biggest hang up is that it's a CSV file, that or that the file is not open. If there's a way this can be done, please let me know. Currently, I am getting an out of range error.</p>