View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jgreif jgreif is offline
external usenet poster
 
Posts: 3
Default implicit activation


When using the .Net Excel namespace and its various classes to access t
extracrt information from spreadsheets, it is possible to share th
Excel.Application between threads, which might be accessing differen
worksheets from different workbooks loaded into the application. Thi
will fail disastrously if code like

Workbook workbook = app.Workbooks.Open(...);
or
Workbook workbook = app.Workbooks[2];
or
Worksheet worksheet = (Worksheet) workbook.Worksheets[1];
or
Range r2c1 = worksheet.get_Range("A1", "A1");
or
object r2c1Val =((Range) r2c1.get_Item(1,1)).get_Value(objMissing);
etc

changes the active cell or active sheet and this affects other thread
carrying out the same kinds of computations.

The question is, do the methods used above implicitly change the activ
cell or worksheet or anything else? If there are methods whic
implicitly change what is active, is there documentation somewher
which describes these side effects

--
jgreifPosted from http://www.pcreview.co.uk/ newsgroup acces