Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think I figured it out.
sFilename = Application.GetOpenFilename("All files (*.*), *.*") ActiveSheet.OLEObjects.Add(Filename:= _ sFilename, Link:=False, _ DisplayAsIcon:=True).Select Selection.ShapeRange.LockAspectRatio = msoFalse Selection.ShapeRange.Height = 11.25 Selection.ShapeRange.Width = 48# AlbertYWang wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Embedding jpeg files into Excel worksheet that can be emailed | Excel Discussion (Misc queries) | |||
Embedding .swf files in Excel 2003 | Excel Discussion (Misc queries) | |||
Automate Hyperlinks to files | Links and Linking in Excel | |||
Embedding excel files into Outlook emails | Excel Programming | |||
Embedding Images and/or Word Processor/Text Files in Excel | Excel Discussion (Misc queries) |