View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Object vs. New File in beforeSave event

I'm confused, happens often <g

Are you trying to check if a workbook is effectively an inserted object in
another app which works in Excel ?

I inserted a workbook in Word, activated it, pressed Alt-F11 and it opened
Excel's VBE

I selected Worksheet in Document1, then in the immediate window
? thisworkbook.IsInplace
True

Similar if in IE

But I guess I'm not quite following what you are doing.

Regards,
Peter T

"Felix" wrote in message
...
Thanks Peter, Unfortunatelly Lotus Notes (the database the object is

embedded
in) opens the object (file) in Excel and just modifies the Excel File

Menus
(adds close & return, save copy as and a few other items). Since it is
(technically) open in Excel the Inplace property is False.
Any other thoughts ?

"Peter T" wrote:

b = wb.IsInplace ' true = embedded

Regards,
Peter T


"Felix" wrote in message
...
I have build an Add-in and capture the Beforesave Event of all Excel
workbooks my users work with. occasionally my users will open excel

workbooks
from a database were the files are actually embeded objects. I have to

treat
these files differently than the files my user manipulates on the Hard

drive.
Currently I differentiate them by getting the OpenPath property from

the
Workbook. If it is an Object OpenPath="" all other files have OpenPath

=
"<path of some sort" which I then use for further validation. This

works
great as long as the file I'm working with is not a new workbook that

has
never been saved, in that instance OpenPath="" which makes my code

think
it's
opend from the database as an object while it is not.
Anybody can think of an easy way in the beforesave event to

differentiate
the Object from a new workbook ? This is probably realy simple I can

just
not
think of it right now.