LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Exporting embedded OLE objects to file

What about pasting the object with a particular filename? With the code
given, the object is pasted correctly. However, by default, the
filename used in the pasting is the filename that was specified during
the Insert Object Create from File process (initial insert of the
object).

(For explicit example: If the path for Insert Object Create from
File is C:\av.mdb, the output will be always been av.mdb when I use
your code)

Is there anyway to change this default filename used in the paste?

If not, is there anyway to get the current "file source" (filename) of
an OLE object?

okaizawa wrote:
Hi,
Here is an exsample:

Sub Test()
'copy oleobject
ActiveSheet.OLEObjects("Object 1").Copy

'paste to activeworkbook's path
CreateObject("Shell.Application") _
.Namespace(ActiveWorkbook.Path) _
.Self.InvokeVerb "Paste"
End Sub

InvokeVerb Method
http://msdn.microsoft.com/library/en...invokeverb.asp

--
HTH
okaizawa

wrote:
Extra info:

(Methods I've tried, unsucessful)

One way in which I did it was to copy the OLE to the clipboard then go
to the File Open window. Then sendkeys tab to the white file part,
sendkeys Ctrl+V to paste the file. This works, but the sendkeys is
unreliable.

Another way I tried was to copy the the OLE to clipboard then use API
on Windows Explorer. I tried running RunMenuByString (common example
function found online) but for some reason the API will not work in
Windows Explorer, it did work in Notepad (?). Is Windows Explorer
protected somehow from API calls?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedded objects(?) Brad Excel Discussion (Misc queries) 2 September 18th 09 04:45 PM
Embedded Objects JLMHoss Excel Discussion (Misc queries) 0 June 18th 08 03:56 PM
Embedded Objects Pete[_3_] Excel Discussion (Misc queries) 2 January 18th 08 05:03 PM
Embedded objects Mike25 Excel Discussion (Misc queries) 1 March 23rd 06 02:05 PM
embedded objects John[_62_] Excel Programming 0 October 29th 03 08:05 PM


All times are GMT +1. The time now is 03:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"