ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   BackgroundWorker and Excel (https://www.excelbanter.com/excel-programming/398022-backgroundworker-excel.html)

NewToVB

BackgroundWorker and Excel
 
I'm using Visual Studio 2005 and programming with Visual Basic so its very
similar to VBA. I have a process that runs and compares two different
spreadsheets and does a few vlookups and some other tasks. But when I'm
running this program I can't use excel because if I do, it throws my process
off because in several cases my program references the active workbook. When
I'm trying to work with excel manually while my program is running the excel
spreadsheets I've called are no longer the active sheets. Could I used
BackgroundWorker to solve this problem by having my program to run on a
different thread? If so how do I do this??

Keithlo

BackgroundWorker and Excel
 
I don't know about that, but couldn't you open a separate instance of Excel
for the ones you're working on manually, instead of opening your files in the
instance that your program is going to use? And if you're not sure which
instance your program is going to use, couldn't you have your program declare
its own instance of Excel before it starts working?

Hope this helps.

Keith

"NewToVB" wrote:

I'm using Visual Studio 2005 and programming with Visual Basic so its very
similar to VBA. I have a process that runs and compares two different
spreadsheets and does a few vlookups and some other tasks. But when I'm
running this program I can't use excel because if I do, it throws my process
off because in several cases my program references the active workbook. When
I'm trying to work with excel manually while my program is running the excel
spreadsheets I've called are no longer the active sheets. Could I used
BackgroundWorker to solve this problem by having my program to run on a
different thread? If so how do I do this??


NewToVB

BackgroundWorker and Excel
 
Thanks for your response. I have it running in its own instance but when I
go to use excel manually while my program is running (even if I have the
visible property set to false) it throws the program off and it will start
reading data from the excel sheet that I've opened manually. :(

"Keithlo" wrote:

I don't know about that, but couldn't you open a separate instance of Excel
for the ones you're working on manually, instead of opening your files in the
instance that your program is going to use? And if you're not sure which
instance your program is going to use, couldn't you have your program declare
its own instance of Excel before it starts working?

Hope this helps.

Keith

"NewToVB" wrote:

I'm using Visual Studio 2005 and programming with Visual Basic so its very
similar to VBA. I have a process that runs and compares two different
spreadsheets and does a few vlookups and some other tasks. But when I'm
running this program I can't use excel because if I do, it throws my process
off because in several cases my program references the active workbook. When
I'm trying to work with excel manually while my program is running the excel
spreadsheets I've called are no longer the active sheets. Could I used
BackgroundWorker to solve this problem by having my program to run on a
different thread? If so how do I do this??



All times are GMT +1. The time now is 06:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com