Note that there are some explanatory texts on larger screens.

plurals
  1. POVB spread sheet writing lock
    primarykey
    data
    text
    <p>at the moment I have a small application and need to take information from an object and display it into an excel file, using the Microsoft.office.interop class I've been able to write to the file, and it shows one by one the records being added, however about once every 3 times I try it, the spreadsheet stops filling somewhere between the 300th and 600th record, I have 6,000 in total and it's not breaking every time, I put a check after it finishes to see whether the last record is filled in but the code never reaches that point and I'm unsure of what's happening</p> <p>I also don't know how to debug the problem as it'd mean going through 6,000 loops to check for it stopping... which might not even happen?</p> <p>a little section of the code is here</p> <pre><code>loadExcel(incidents, WorkSheetName) If WorkSheetName.Cells(DBObject.HighestInci + 1, 6) Is Nothing Then MessageBox.Show("Failed to fill spreadsheet, Retrying now.") loadExcel(incidents, WorkSheetName) End If </code></pre> <p>above is the code calling and checking the method below</p> <pre><code>Private Sub loadExcel(ByVal incidents As List(Of Incident), ByRef WorkSheetName As Excel.Worksheet) Dim i = 2 For Each inc As Incident In incidents WorkSheetName.Cells(i, 1) = inc.DateLogged WorkSheetName.Cells(i, 2) = inc.DateClosed WorkSheetName.Cells(i, 3) = Convert.ToString(inc.DateLogged).Substring(3, 2) i += 1 Next End Sub </code></pre> <p>Thanks in advance</p> <p><em>EDIT</em> </p> <p>I'm thinking loading it to a buffer of some sort then writing once they have all been updated would be the way to go instead of it currently loading and writing each separately? however I have no idea where to start for that?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload