Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi All,
Im looking for a way to not only insert/embed an object into my worksheet (which works below), but have the directory select the file based on an existing PDF named file. I have users entering data into certain cells which in turn uses a formula to concatenate their entries into cell A1. This cell will be the name of the file thats already residing out on the noted path. So far, I can only get it to embed the file when the name is static (hardcoded name in question mark fields). Id like to instead have it select the file based on the name in the A1 cell. The worksheet is called Sheet1 and again the cell that names the PDF is A1. Any thoughts or ideas on how to make this happen? Thanks in advance Jenny B. Sub InsertNamedObject() ActiveSheet.OLEObjects.Add(Filename:= _ "C:\Documents and Settings\Jenny B.\My Documents\???????", Link:= _ False, DisplayAsIcon:=True, IconFileName:= _ "C:\WINDOWS\Installer\{AC76BA86-1033-F400-7760-000000000004}\_PDFFile.ico", _ IconIndex:=0, IconLabel:= _ "C:\Documents and Settings\Jenny B\My Documents\BKA1303005.PDF").Select End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Something like the below...
Sub InsertNamedObject() Dim strFile As String 'If sheet1 is the active sheet strFile = Trim(Activesheet.Range("A1")) 'If Sheet1 is not the active sheet 'strFile = Trim(Sheets("Sheet1").Range("A1")) ActiveSheet.OLEObjects.Add(Filename:= _ "C:\Documents and Settings\Jenny B.\My Documents\" & strFile, Link:= _ False, DisplayAsIcon:=True, IconFileName:= _ C:\WINDOWS\Installer\{AC76BA86-1033-F400-7760-000000000004} _PDFFile.ico", _ IconIndex:=0, IconLabel:= _ "C:\Documents and Settings\Jenny B\My Documents\BKA1303005.PDF").Select End Sub If this post helps click Yes --------------- Jacob Skaria "Jenny B." wrote: Hi All, Im looking for a way to not only insert/embed an object into my worksheet (which works below), but have the directory select the file based on an existing PDF named file. I have users entering data into certain cells which in turn uses a formula to concatenate their entries into cell A1. This cell will be the name of the file thats already residing out on the noted path. So far, I can only get it to embed the file when the name is static (hardcoded name in question mark fields). Id like to instead have it select the file based on the name in the A1 cell. The worksheet is called Sheet1 and again the cell that names the PDF is A1. Any thoughts or ideas on how to make this happen? Thanks in advance Jenny B. Sub InsertNamedObject() ActiveSheet.OLEObjects.Add(Filename:= _ "C:\Documents and Settings\Jenny B.\My Documents\???????", Link:= _ False, DisplayAsIcon:=True, IconFileName:= _ "C:\WINDOWS\Installer\{AC76BA86-1033-F400-7760-000000000004}\_PDFFile.ico", _ IconIndex:=0, IconLabel:= _ "C:\Documents and Settings\Jenny B\My Documents\BKA1303005.PDF").Select End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
That did it!
Thank you very much for taking the time to reply and appreciate the prompt response. Jenny B. "Jacob Skaria" wrote: Something like the below... Sub InsertNamedObject() Dim strFile As String 'If sheet1 is the active sheet strFile = Trim(Activesheet.Range("A1")) 'If Sheet1 is not the active sheet 'strFile = Trim(Sheets("Sheet1").Range("A1")) ActiveSheet.OLEObjects.Add(Filename:= _ "C:\Documents and Settings\Jenny B.\My Documents\" & strFile, Link:= _ False, DisplayAsIcon:=True, IconFileName:= _ C:\WINDOWS\Installer\{AC76BA86-1033-F400-7760-000000000004} _PDFFile.ico", _ IconIndex:=0, IconLabel:= _ "C:\Documents and Settings\Jenny B\My Documents\BKA1303005.PDF").Select End Sub If this post helps click Yes --------------- Jacob Skaria "Jenny B." wrote: Hi All, Im looking for a way to not only insert/embed an object into my worksheet (which works below), but have the directory select the file based on an existing PDF named file. I have users entering data into certain cells which in turn uses a formula to concatenate their entries into cell A1. This cell will be the name of the file thats already residing out on the noted path. So far, I can only get it to embed the file when the name is static (hardcoded name in question mark fields). Id like to instead have it select the file based on the name in the A1 cell. The worksheet is called Sheet1 and again the cell that names the PDF is A1. Any thoughts or ideas on how to make this happen? Thanks in advance Jenny B. Sub InsertNamedObject() ActiveSheet.OLEObjects.Add(Filename:= _ "C:\Documents and Settings\Jenny B.\My Documents\???????", Link:= _ False, DisplayAsIcon:=True, IconFileName:= _ "C:\WINDOWS\Installer\{AC76BA86-1033-F400-7760-000000000004}\_PDFFile.ico", _ IconIndex:=0, IconLabel:= _ "C:\Documents and Settings\Jenny B\My Documents\BKA1303005.PDF").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
embed alignment in csv file | Excel Discussion (Misc queries) | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
How do I embed an email in an excel file? | Excel Discussion (Misc queries) | |||
how do i embed a file in a workbook | Excel Discussion (Misc queries) | |||
How do I embed a PDF file within Excel | Excel Discussion (Misc queries) |