Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLEObject event?

Status
Not open for further replies.

DrSimon

IS-IT--Management
Dec 14, 2001
674
GB
We have a process where external files (usually word docs) are embedded into Excel worksheets. I want to be able to detect when such object is inserted. My current thought would be to count OLEObjects before and after some change, but Workbook_SheetChange isn't triggered by inserting an object. Does anyone know if there is any other event I could use?
Thanks in advance.
 
What about the SelectionChange event ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the suggestion, but it doesn't seem to get triggered either. Also I need a Workbook event as the user could be creating new sheets.

Simon
 
Then how about the Worksheet_SelectionChange event? Check the change in Shapes count the the Sh object.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks Skip - same problem really as any new sheet won't contain the code. I'd already done what you suggested in Workbook_BeforeSave, but would liked to have been able to trigger before that. Thanks anyhow,

Simon
 
Have you tried the Workbook_SheetActivate, Workbook_SheetDeactivate and/or Workbook_SheetChange ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I meant to say the Workbook_SelectionChange event --ONE event for ANY sheet, each sheet contains NO CODE!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Skip, I think you meant the Workbook_SheetSelectionChange event.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes. I'm on an iPad -- no Excel ref. Sorry!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
All good tries, but none of them triggered by inserting an object. The change events all get triggers happily when selecting a cell or changing text, but once that's done and I insert the object - nothing! Similar for Activate events. I think I'll have to stick to the Workbook_BeforeSave event.
Simon
 
Each time the selection changes on a sheet or a sheet is deactivated, compare the shape count to the last shape count stored in a public array.

It is an indirect method.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks Skip. I had already worked that out. There clearly is no event triggered by an object itself.
Thanks all for trying - let's close this as nothing more is coming out of it.

Simon
 
1. Please outline the process that occurs surrounding this object?

2. Is this object PUSHED into Excel from some external process, or is it PULLED into Excel by some internal process?

3. What might be the NEXT event that should happen in Excel following this object being added?

My probing question skirting the HOW issue of your question, but rather focusing on the WHAT. WHAT happens previous to this object being added and WHAT needs to follow the adding of the object, related to that object.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top