View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Felix Felix is offline
external usenet poster
 
Posts: 78
Default Object vs. New File in beforeSave event

Not confused. That's exactly what I'm trying ;-) , you are right on the money.
Try this - it will behave the same way as my database scenario.

Open a new Word document then insert an existing Excel file as an Object
(Insert Object .. from file) and select show as icon.

I think the difference between what we are doing is the "show as icon" part.

Now if you double click on the icon in the Word doc it will open the Excel
file in the Excel UI. This is how my objects from the database look and feel.
Now I'm looking for some property or something that will me destinguish this
object from a never saved file.

Hope I explained this OK.

"Peter T" wrote:

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.