Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does an Excel VSTO addin run slower on a higher spec machine?

I've developed an Excel 2003 addin in C#, using VSTO and VS 2008. The addin works just fine on my machine (HP NC6320 laptop, 3gb RAM T5600 1.8ghz Core2 cpu), however when it is tested on another users machine (HP nc6710b laptop 2gb RAM, T7200 2ghz Core2 cpu), it is substantially slower. I've also tried it on another laptop the same type as mine, and it is also fast

I've been through the obvious things, like applications running, Antivirus stuff, etc. The machines are both fully patched, and up to date.

Basically, what the addin does is: 1. Read data from a SQL Server 2005 database 2. Do some manipulation on it 3. Display it on a worksheet, and format it appropriately

The slow bit is the displaying on the worksheet.

I'm stumped as to why it would be slower on a newer machine.. Just to really confuse myself, I tried it on a VM (VMware Workstation v6.5) with 256mb RAM, and 1 cpu, running xp and only Office 2003 installed on it, and it was substantially quicker than the new laptop.

So in summary, an Excel Addin performs quickly on a low spec VM, and on an older laptop, but on a newer spec laptop it is slower.

Any suggestions would be gratefully recieved ?

Many thanks

Nick

edit:

Ok, I've checked the printer drivers, they are the same... I've checked the fragmentation levels, and if anything, the faster machine is less fragmented than the slower one..

Am looking at the events settings..

like image 352
Nick Haslam Avatar asked Dec 17 '22 08:12

Nick Haslam


2 Answers

You can also add

Application.EnableEvents = False  

to your code before starting dumping your data to spreadsheet to stop any other Excel Add-Ins or any VBA code waiting for applciation level change/update events. Don't forget to re-enable events after your are done!!

like image 165
Adarsha Avatar answered Feb 01 '23 23:02

Adarsha


Check that the slow machine does not have any XLA or COM addins installed (ie Google Office Addin) or any other potentially event-trapping code in Personal.XLS etc

Presumably you are already doing all the standard speedup things such as: - turning off automatic calculation and screenupdating before writing to XL - writing and formatting cells in a single large block rather than cell-by-cell - ...

like image 34
Charles Williams Avatar answered Feb 02 '23 00:02

Charles Williams