R
Ray C
I have a client that wants me to automate some manual Excel file
manipulation. The solution is to use an Access database to completely
automate the opening, editing and saving of an Excel worksheet. I placed all
the necessary data and parameters into Access tables (normalized).
Some of the VBA code used for the "editing" of data was copied and pasted
from Excel to an Access module. After all, both products use VBA. I looked at
some of his code and it is as efficient as it can get...
However, I noticed that when the same function runs within Access, the code
takes a lot longer to execute. But when the same code runs inside Excel, it's
a lot faster. The function simply iterates all the lines in the worksheet and
deletes the lines that have a certain value.
When I manipulate the Excel worksheet from within Access (using the same
code to iterate the lines) it takes a lot longer. Here are the results:
Iterating 30,000 lines:
Within Excel , less than a minute.
Within Access, 17 minutes!
Am I to conclude that iterating lines is done faster in Excel? I would
assume this to be true since it's the worksheet being edited, but to see a
difference of this magnitude? it's shocking.
Ray
manipulation. The solution is to use an Access database to completely
automate the opening, editing and saving of an Excel worksheet. I placed all
the necessary data and parameters into Access tables (normalized).
Some of the VBA code used for the "editing" of data was copied and pasted
from Excel to an Access module. After all, both products use VBA. I looked at
some of his code and it is as efficient as it can get...
However, I noticed that when the same function runs within Access, the code
takes a lot longer to execute. But when the same code runs inside Excel, it's
a lot faster. The function simply iterates all the lines in the worksheet and
deletes the lines that have a certain value.
When I manipulate the Excel worksheet from within Access (using the same
code to iterate the lines) it takes a lot longer. Here are the results:
Iterating 30,000 lines:
Within Excel , less than a minute.
Within Access, 17 minutes!
Am I to conclude that iterating lines is done faster in Excel? I would
assume this to be true since it's the worksheet being edited, but to see a
difference of this magnitude? it's shocking.
Ray