LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Automate embedding files

I have an application where I am using an Excel 2000 workbook as a
master document to contain other documents( .xls, .doc, .rtf, .txt,
..ppt, .msg, ...) for review. I want to be able to open an embedded
file in it's original application.

I have figured out how to do this manually by inserting an object
created from a file, and displaying as an icon. I can also change the
size of the icon to fit within a cell.

By using the macro recorder and VBA, I have figured out how to start an
open file dialog, embed an arbitrary Excel file and resize the icon
with:

sFilename = Application.GetOpenFilename("All files (*.*), *.*")
Workbooks.Open Filename:=sFilename
ActiveWindow.Visible = False
ActiveSheet.OLEObjects.Add(Filename:= _
sFilename, Link:=False, _
DisplayAsIcon:=True, IconFileName:= _

"C:\WINNT\Installer\{00020409-78E1-11D2-B60F-006097C998E7}\xlicons.exe",
_
IconIndex:=0, IconLabel:= _
sFilename).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 11.25
Selection.ShapeRange.Width = 48#

But this doesn't work with other file types( e.g. - .doc, .ppt, ...).
How can I generalize this to work with arbitrary file types?

Albert Wang

 
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
Embedding jpeg files into Excel worksheet that can be emailed zuesco Excel Discussion (Misc queries) 2 October 5th 09 08:44 PM
Embedding .swf files in Excel 2003 It Is Me Here Excel Discussion (Misc queries) 3 December 23rd 07 02:58 AM
Automate Hyperlinks to files Parisa Links and Linking in Excel 1 May 20th 06 03:50 PM
Embedding excel files into Outlook emails lithium81[_7_] Excel Programming 1 December 16th 05 09:31 AM
Embedding Images and/or Word Processor/Text Files in Excel Vince Excel Discussion (Misc queries) 2 June 1st 05 09:46 PM


All times are GMT +1. The time now is 10:21 PM.

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"