title: Permission Denied opening an Excel File using Excel 12.0 Library & VB6
body: <p>I have used Excel in my VB6 apps many times before, and have never run into such a weird problem trying to accomplish something very easy..</p>
  
  <p>I am trying to open an excel (xls or xlsx) file and read through values, as you can probably see.</p>
  
  <p>When I try to open the file, I get an error 70 (permission denied) error. The odd thing is that there is no other instance of excel open (in task manager apps or processes). No one else is trying to access the file whatsoever. I can open the file in excel with no warning, and I can also open/read/close the file in VB6 with the basic "Open File for Input as #1" syntax without error. I can delete the file using Kill() so it can't be a directory permissions issue - Please help - I am at a loss!!!</p>
  
  <pre><code>  Dim xlApp As New Excel.Application
  
    Dim xlWBook As Excel.Workbook
  
    'Error Occurs Here
    Set xlWBook = xlApp.Workbooks.Open(File)
  
    Dim xlSheet As Excel.Worksheet
    Set xlSheet = xlWBook.Sheets.Item(1)
  
    Dim y As Integer
    For y = 1 To 99999
      If Len(xlSheet.Cells(y, 1)) &gt; 0 Then
        Send xlSheet.Cells(y, 1) &amp; " - " &amp; xlSheet.Cells(y, 2) &amp; "&lt;br&gt;"
      End If
    Next
  
    Set xlWBook = Nothing
    Set xlApp = Nothing
  </code></pre>
  
  <p>-Jay</p>