2
votes

Operating System : Microsoft Windows SP1 (64 bit)

Office Suite : Microsoft Office 2010

.Net Framework : 4.0

Subject : Microsoft suites of applications (Word, Outlook) does not respond for the time slice when a excel plugin code is running

Details : We have written VSTO (in C#) based add-in for excel application. This add-in is used for refreshing data in current sheet.

Following steps of events occurs on click of a "Refresh" button

•A call is made to internal web service by passing some metadata to download a file

•File is downloaded and stored on windows Temp folder.

•A VSTO code is executed to copy data from downloaded sheet to current sheet using Clipboard Copy / Paste. Data is copied row by row.

At any point in time, we'll have one row of data in Clipboard. Also the number of rows and columns varies between request.

Issue: While refresh functionality is working as expected, we are experiencing issue with other Office suites applications (Word, Outlook).

For the time slice refresh is running, all Office suites of application stops responding.

Can some one help with this issue?

1

1 Answers

0
votes

I think you can not control other office suites application. But what you can do is, try to decrease the time slice for refresh button By using different concept like

•A call is made to internal web service by passing some metadata to download a file

•File is downloaded and stored on windows Temp folder.

I don't know for above two point whether you have used separate thread for that or not? If not use separate thread for that.

You can also use some Optimization trick while copy pasting data from one sheet to another.

Here are some tricks to optimize vba / vsto code

http://tchhabhaiya.blogspot.in/2012/06/17-ways-to-optimize-vba-code-for-faster.html

I think below code will help a lot to you if you haven't used this.

Application.ScreenUpdating = False //To Turn Off at the start of code.
Application.ScreenUpdating = True //To Turn on at the end of the code.