Detect if Spreedsheet/workbook is the embedded object in Word

M

Maneesh S

The user have a embedded Excel Spreadsheet in Word that they right Click and
Open in execl application. I have a custom addin that gets called for Excel
on close event and ask the user to save the document.

My issue is when the Excel Spreadsheet is embedded in word and the user
right click on the embedded Spreadsheet and open in Excel, I do no want the
Close event from my custom addin to ask the user to save the document.
Is there a property or API I can use to detect if the Spreadsheet in Excel
opened from another Office application like Word. I have already tried
WorkBook.IsInplace property and that does not seem to solve the issue for me.

Thanks
Maneesh S
 
M

Maneesh S

I want to know if there is a way to detect if the opened Excel
Spreadsheet/workbook is embedded in another OLE document object
like word or Outlook email

Thanks
 
S

sdavern

Hello Maneesh.
I have the exact same question as you've posted. Have you found any
solutions?
In my case I have a number event handling routines that I want to
respond approapriately if Excel was opened as an embedded object in
another application. Furthermore, if a user uses Excel to copy and
paste Excel content into another application as an embedded object I'd
like to be able to detect if the object created(workbook) is
associated with the embedded object.
Perhaps this would be better placed in another forum.
Thanks,
Sean
 
M

Maneesh S

Hey Sean,

Sorry for the late reply.

I still have found a proper solution which would my issue. But I was able to
come up with a workaround/hack. I noticed that each time an embedded excel
document is opened, the name of the excel file is "Worksheet in <Name of doc
containing the embedded excel doc> "
So I tested this to my advantage and came up with when an excel document is
opened I get the name of the opened excel file.
If the file name contain "Worksheet in", I know it is an embedded excel doc.
This works for both word and powerpoint.

However this did not work for me due to localization in other languages. You
might to give it a shot if you have not found a solution yet.

Unless you have found a solution for this

Thanks
Maneesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top