If it does anything at all when coming from COM I wouldn't know since I have not done it enough to tell.So lets skip right to limiting the back and forth through layers and just throw the others in for good measure.I was in a forum recently, when I came across a question on how to get or read data from a closed excel workbook (file) without actually opening it. I have an Excel file (the source), where I regularly update the Sales figures for each region.In-addition, I have another excel file, which would automatically get the figures from the source file, without opening it. Open("C:\Q-SALES.xlsx", True, True) Once I get the data, I’ll count the number of rows in the source workbook.
For this we will use VBA inside of Excel to demonstrate a couple issues. Suppose you have a sheet in which you have values in column A and column B.
The simple ways to avoid the first two items above is to turn the updating off near the beginning of your code.
This can be done in the example above by adding two simple lines Code with these changes is significantly faster.
In our example we noted that the screen updating, calculation, and working with each cell individually adds a tremendous amount of time.
Taking that knowledge and applying it when we access Excel will make a huge difference in the time required to run our code.