|
-
Apr 16th, 2014, 12:48 PM
#1
Thread Starter
New Member
VB.Net VSTO for Excel Timer Event locks up Excel
I have a VB.Net addin for Excel that let's the user download data files from a ftp location based on an ip address, and import those data files into a spreadsheet. In fully manual mode, ie user selects the files in a dialog and then the work is done, everything works fine.
But my client wants the process to be automated. This means by pushing a ribbon button, an ftpmonitor object continually scans the ftp site for new files. When it finds one, it downloads it and imports the file to a spreadsheet. Then the user can push another button in the ribbon to cancel monitoring the ftp. This works, but it takes about 50 times longer for the data to populated the sheet than in manual mode. I learned that because Excel is not a multitasking environment, having another thread ( the timer activated ftpmonitor ) interact with Excel slows everything down.
So I tried simulating a timer event with an endless loop of DoEvents() in a while loop. That made the data import to the sheet just like manual mode, but now we can't interact with the ribbon to cancel monitoring. Excel is held captive by the addin. The only way to end the monitoring is to close Excel, which is very bad. I'm beginning to think the only solution is to change from an addin to a true .Net application with Excel automation instead, but that's not what my client wants.
Does anyone know a solution, or know where I need to look to get one? I've searched the web for weeks, and read through an abundance of forums, but nothing really handles this kind of situation.
Thanks for any information that can help me.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|