Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Alan,
That is a great idea - I will definately run with this one to see where it takes me. Glad you like it. Re my "Big point", I meant to add that updating progress 000's of times might take longer than the actual routine on its own - though I see not an issue for you. One question: If I use GetObject to create a reference in NewExcel to OldExcel (and then I can presumably directly control any object in OldExcel from within NewExcel including OldExcel.StatusBar) I will have a reference in both directions (OldExcel will contain NewExcel and NewExcel will contain an Object that is OldExcel). Exactly, cross referrenced instances of Excel, each can manipulate the other. In general is that an issue? Possibly, let's take the least problematic ref first - "xlOld" in NewExcel. I don't know if you want this as Public for later use, or as a one off at procedure level while doing your stuff. In either case eventually it should be set to Nothing. In the example I declared it Public, not knowing how you want to use it as a precaution I set it to nothing in the Auto_close. But do that where ever is most appropriate. "xlNew" in ExcelOld is the one to be concerned with if has been used to create the new instance. Eventually it should be set to nothing but NOT until after NewExcel is closed, either programatically or manually. In the worst case, if NewExcel is not visible, you won't be able to close it without using the task manager, or Ctrl Alt Del and looking for "Excel" and End task. If you are opening your wb in a new instance to do a specific task (visible ?) after which you no longer need the new instance, do this: wb.close false ' or true ? set wb = nothing xlNew.quit set xlNew = nothing If wb and/or NewExcel could have been closed by other means, run the above under "On Error resume next". Re-reading my Test proc I see that I set xlNew to nothing with NewExcel still open. Not a major problem as I also made NewExcel visible. However running this several times might lead to a memory leak. Having said that I didn't notice any problems testing a few times. Conceptually (I am weak on this), I tend to think of object 'trees' with each object being a branch off of its parent. However, in this case we have a circular loop of 'containers'. Is that likely to store up potential issues? I don't see these cross ref's as a "circular loop of 'containers'", so providing the above precautions are followed I don't think there should be any problems. But if anyone wants to step in and say otherwise ... I'll be interested myself. Regards, Peter T |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Access to Variable | Excel Discussion (Misc queries) | |||
Import into Access from Excel, passing a variable for the field... | Excel Worksheet Functions | |||
Transpose a variable length list into Excel / Access Table | New Users to Excel | |||
Trying to access different files depening on a variable | Excel Discussion (Misc queries) | |||
I Need VBA Assistance regarding passing a variable from Access | Excel Programming |