Why is my app so slow when writing from VB to Excel

20 pts.
Tags:
Microsoft Excel
Visual Basic
What I use: An app where following procedure has to be run approx 100.000 times... it takes 5 minutes! It should go faster.
Question=how?
Dim Record as string Dim oExcel As Microsoft.Office.Interop.Excel.Application Dim EXCBook As Object, Range as object oExcel = New Microsoft.Office.Interop.Excel.Application EXCBook = oExcel.Workbooks.Open(TxtFolder.Text & "FBL.xlt") Record = strLine & vbTab & strSort & vbTab & Date 'sets the values for column 1, 2 & 3 in the Row Clipboard.SetText(Record.ToString) Range = EXCBook.Worksheets(Page).cells(Row, 1) EXCBook.Worksheets(Blad).Paste()

Software/Hardware used:
vb studio 2005 & excel 2003

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hopefully abc can provide us with additional details.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Ben Rubenstein
    Welcome to ITKE, abc. One of our VB experts should be able to help soon.

    In the meantime, make sure to fill out your profile fully with your picture and bio, and check out the FAQ page for more on how our community works. 
    5,200 pointsBadges:
    report
  • TomLiotta
    ...following procedure has to be run approx 100.000 times... it takes 5 minutes!   Does that mean that you expect to invoke and run that code more than 333 times per second?   Can you describe the environment? What is it running on? How is it called?   Tom
    125,585 pointsBadges:
    report
  • ToddN2000
    I never sent data to an Excel spreadsheet myself but why not send as a dataset/datatable instead of on a record basis? 
    8,560 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following