title: Excel Interop worksheet HRESULT: 0x800A03EC using VB.net
body: <p>so in my vb.net application, I am pulling data (about 1046 rows in the table) from database to pre-load the contents in excel spreadsheet. This works fine until 999 rows, but if it exceeds more than 999 rows it gives me that particular error. 
  Just wondering if there is a restriction. Any ideas? I am using windows 10, management studio 2012 and excel 2007.</p>
  
  <p>Code:</p>
  
  <pre><code>Private Sub readEmployee(ByVal employee As data.employeeList)
  
              Dim excelWorkSheet As Excel.Worksheet 
              Dim startRow As Integer = 9
              Dim firstNames As String = ""
              Dim lastNames As String = ""              
  
              With excelWorkSheet  
                  startRow = 9
                  Dim row As data.employeeList.employeeListRow
                  For Each row In employee.employeeList
                      If row.RowState &lt;&gt; DataRowState.Deleted Then
  
                          firstNames = CStr(IIf(row.FirstName.Trim() = "", "", row.FirstName.Trim()))
                          lastNames = CStr(IIf(row.LastName.Trim() = "", "", row.LastName.Trim()))
  
                          .Range("A" + startRow.ToString("n0")).Value = lastNames
                          .Range("B" + startRow.ToString("n0")).Value = firstNames          
                          startRow += 1
                      End If
                  Next
              End With
      End Sub
  </code></pre>