Home > Software engineering >  VBA is slow to read the file
VBA is slow to read the file

Time:10-28

With Windows 7 excel vba 2010 run read twenty thousand pairs of data and processing for a few minutes

In the same code win10 excel 2016 is two hours

What reason is this?

CodePudding user response:

The key depends on the code

CodePudding user response:

Will Excel save as CSV, using C language processing,

CodePudding user response:

Since "the same code", the time difference is so big, nature is the relationship between "software environment" is bigger,
You use 2016 processing, it is always special slow?


But this a few minutes, with two hours, the gap is a little bigger...

CodePudding user response:

Is too much,, but can't find the reason

CodePudding user response:

According to the amount of data in 2016 if the data of several hundred is a few minutes

CodePudding user response:

Where is slow, data processing, data import and can determine if data processing is slow in which processing steps, and then take the slow code out discussion, at present, as well as the subsequent you describe your problem, can only say that you understand why you worry, but no one help got you

CodePudding user response:

Automatic calculation and refresh close to try

CodePudding user response:

The
reference 7 floor muruku_x response:
turn off automatic calculation and refresh try

CodePudding user response:

Sub the clear ()
'removal system useless connection
Dim owcs As WorkbookConnection
For Each owcs In Excel. ThisWorkbook. Connections
With owcs
. Delete
End With
Next
'clear clipboard
Application. CutCopyMode=False
End Sub

You add this, with a button or automatic run and see, I use this after the file size smaller, faster, and is mainly a lot of redundancy can't see,

CodePudding user response:

2016 more than 2010 processing a lot of special effects, so if it is to much the object 2016 will be slow, so should be less than optimal code, and try to reduce operating object
  •  Tags:  
  • VBA
  • Related