Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamically adding ActiveX controls via VBA kills global VBA heap?
Let me see if I understand this properly.
If you either add or delete an ActiveX control to a worksheet dynamically via VBA code, you trigger an involuntary and automatic RECOMPILE of the VBA environment, which instantly wipes out *ALL* the global variables stored in the heap? (Oh, and WITHOUT TRIGGERING ANY WARNINGS, even for a WATCH set to break on "any changes to the value"?!!!) ....Which would also explain why you get the "Cannot enter break mode at this time" error rather abruptly if you hit f8 in the debugger on the line that does something ilke this: sheet1.oleobjects.add(msoPickAShapeConstantHere, top, left, height, width) or this: sheet1.oleobjects("MyShapeNameHere").delete I have just ONE little question. WHY THE HECK IS THIS NOT FEATURED *VERY PROMINENTLY* IN THE DOCUMENTATION FOR THE OLEOBJECTS METHODS!!!??? This is a *SERIOUSLY limiting behavior* for anyone wanting to actually use the capabilty to dynamically create/delete OLEObjects/ActiveX controls at runtime! ....well, at least from a VBA application (I suppose that this wouldn't matter too much for VSTO developers, since they don't usually have to care about the VBA environment's heap objects very much.) If I have this wrong in any way, could somebody please tell me? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ActiveX Controls | Excel Discussion (Misc queries) | |||
ActiveX Controls vs Form Controls | Excel Discussion (Misc queries) | |||
add controls on the fly/dynamically | Excel Discussion (Misc queries) | |||
Create controls dynamically | Excel Programming | |||
Referring to a local or global variable or constant dynamically? | Excel Programming |