Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8069945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:13:54+00:00 2026-06-05T13:13:54+00:00

at the moment I have a small application and need to take information from

  • 0

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

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?

a little section of the code is here

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

above is the code calling and checking the method below

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

Thanks in advance

EDIT

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:14:00+00:00Added an answer on June 5, 2026 at 1:14 pm

    I’ve fixed my problem, with what I had above Excel was opened and it started printing into the spreadsheet line by line, the problem is that any interactions with excel would cause the process to freeze

    By adding an

    ExcelApp.visible = false 
    

    before carrying out the process and an

    ExcelApp.visible = true 
    

    afterwards, it all works and then opens the file afterwards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to objective-c and at the moment developing a small application. I have
I have a small scraper where I need to click an anchor link using
I'm busy with a small application in which I want to display information at
At the moment I have a combobox that is populated from the name fields
I'm building a small timing application using the MVVM pattern, using entity framework for
I'm using SilverLight on Visual Studio 2008, Ver 3.5 SP1, I have a small
I have been writing a small java application (my first!), that does only a
At this moment I start work on small web application based on MVC. Now
I have written a small client server socket application. It is a proof of
I am developing a small client / server application in C. At the moment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.