AJUDA COM DEMORA NO CARREGAMENTO DE DADOS

KURTGU 22/07/2015 22:17:17
#449143
Ajudar Com Velocidade de Carregamento de 500 linhas de um Arquivo Excel....Pessoal estou tentando a alguns dias fazer a leitura de uma arquivo excel, pois bem consegui fazer a tal leitura e jogar da forma que precisa dentro de um listview mais por algum motivo, demora bastante para carregar...Gostaria se possível que alguém dessse uma olhada para mim aonde estou errando...Exemplo do que estou fazendo juntamente do arquivo que estou carregando em anexo...






TUNUSAT 23/07/2015 08:19:04
#449146
Resposta escolhida
KURTGU,

Fucei na teia e achei algumas coisas interessantes, mas é preciso gastar um pouco de tempo para entender tudo...

============================================================
- ARQUIVO [Ô].DOCX[Ô]:
(AcceleratingExcel2010withWindowsHPCServer2008R2Beta2-Final-BRZ.docx)

Windows® HPC Server 2008 R2
...
Desempenho

Usando a solução de cliente SOA de cluster com o cluster do Windows HPC, o cálculo é executado de forma muito mais rápida: de 30 minutos no computador cliente usando as ferramentas padrão do Excel 2010 a menos de 1 minuto no cluster.
...

http://www.google.com.br/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0CCIQFjABahUKEwj-kpi-jfHGAhUBjpAKHRQ4C10&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2FE%2FD%2FF%2FEDF7FC6D-4EF3-4599-A519-1F0A9EA13EAA%2FAcceleratingExcel2010withWindowsHPCServer2008R2Beta2-Final-BRZ.docx&ei=GcqwVb6iCIGcwgSU8KzoBQ&usg=AFQjCNFxQ5wOK8nZE_1f36JTH2dSMAyDNA

============================================================
Excel: Dicas de VBA - Performance
http://www.jorgepaulino.com/2009/09/excel-dicas-de-vba-performance.html
============================================================
Excel Interop - Efficiency and performance
http://stackoverflow.com/questions/356371/excel-interop-efficiency-and-performance
============================================================
Fastest way to write cells to Excel with Office Interop?
http://stackoverflow.com/questions/3096090/fastest-way-to-write-cells-to-excel-with-office-interop
============================================================
Excel sheet code is taking too much time
http://codereview.stackexchange.com/questions/48291/excel-sheet-code-is-taking-too-much-time
...
Just doing that has reduced the number of iterations by half. Now these two blocks look awfully similar. Let[ô]s see if we can extract a method here:
Sub NameMe(Value1 As String, Value2 As String, Row As Long, TheWorksheet As Worksheet, TheArray As Object(,))

Dim Counter As Integer
If (Value1 = Value2) Then

For i As Integer = 0 To 36
TheArray(Counter, i) = TheWorksheet.Cells(Row, i + 1).Value
Next

Counter += 1

End If

End Sub

============================================================
Creating a fast Excel add-in (C#, VB.NET). Reading and updating cells.
https://www.add-in-express.com/creating-addins-blog/2011/09/29/excel-read-update-cells/

The results are:
Method Elapsed time (in milliseconds)
Cell by cell (see Slowest) ~ 56,000
Cell by cell & ScreenUpdating (see Slow) ~ 51,000
All cels at once (see Fast) ~ 600
============================================================
Faster MS Excel Reading using Office Interop Assemblies
http://www.codeproject.com/Articles/9992/Faster-MS-Excel-Reading-using-Office-Interop-Assem
============================================================
Speed up Excel action
http://searchwindevelopment.techtarget.com/tip/Speed-up-Excel-action
============================================================
Speed Up Excel Macro Execution
http://snipplr.com/view/65505/speed-up-excel-macro-execution/
============================================================
Multithreading to [Ô]speed[Ô] up Excel automation?
http://www.xtremevbtalk.com/archive/index.php/t-179336.html
============================================================
Excel VBA program only running at 25% speed
http://superuser.com/questions/789154/excel-vba-program-only-running-at-25-speed
============================================================

[][ô]s,
Tunusat.
KURTGU 23/07/2015 08:53:24
#449148
Tunusat to tentando fazer um delete nas colunas que nao vou ultilizar e deixar somente as que irei ultilizar mais todo exemplo que aCHO nao funciona...
Tópico encerrado , respostas não são mais permitidas