View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Anton Rapoport Anton Rapoport is offline
external usenet poster
 
Posts: 3
Default Saving embedded OLE object as file to hard disk

Hello, Excel experts

I have faced the following problem (I will not be surprised if it cannot be
solved at all in Excel VBA):

Excel allows to embed an OLE object into a worsheet. Manually a user has to
click "Insert" from the main menu, then "Object", then choose the "Create
from file" tab and then select a file to embed. A user is free to embed any
(generic) file with any file extension, e.g. test.zip or test.tst or whatever
which may not be necessarily associated with a Windows application.

My problem is I need to save the embedded file back to a hard disk. Manually
the user has to right-click on the embedded file icon, then choose "Package
Object", then "Edit Package". After that a separate "Object Packager" window
will appear. There in the "Object pckager" window the user clicks "File" and
"Save contents" to save the embedded file as a file back to a user-selected
location.
But how to do it from VBA code? How can I save a file embedded as object
into the sheet back to hard disk?

Thanks a lot for your help in advance,

Anton


--
Tonioant