Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I link or embed .pdf files into or to an excel file?

I would like to link .pdf files to an excel file. Within my excel file I
would like to have a column that has file names in it. Then have excel link
those files to the excel file so when I print the excel file all the linked
files print along with it.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Can I link or embed .pdf files into or to an excel file?

Hi GrubbyG,

Try to cut and paste this macro code below and run. It is not only PDF but
all the files.

Sub AutoHyperlinkFileNametoExcel()
Dim fnam As Variant

' fnam is an array of files returned from GetOpenFileName
' note that fnam is of type boolean if no array is returned.
' That is, if the user clicks
' on cancel in the file open dialog box, fnam is set to FALSE

Dim b As Integer 'counter for filname array
Dim b1 As Integer 'counter for finding \ in filename
Dim Cell As Range
Dim x As Integer
' first open a blank sheet and go to top left ActiveWorkbook.Worksheets.Add

fnam = Application.GetOpenFilename("all files (*.*), *.*", 1, _
"Select Files to Fill Range", "Get Data", True)

If TypeName(fnam) = "Boolean" And Not (IsArray(fnam)) Then Exit
Sub 'if user hits cancel, then end

For b = 1 To UBound(fnam)

' print out the filename (with path) into first column of new
sheet
ActiveSheet.Cells(b, 1) = fnam(b)
b1 = Len(fnam(b))

' add any other columns to s/s here
' this code makes the drawing name from the filename
' by stripping off the directory name and the extension

Do While Mid(fnam(b), b1, 1) < "\"
b1 = b1 - 1
Loop
Next
'resize the columns

ActiveSheet.Range("a:zz").Columns.AutoFit
x = ActiveSheet.UsedRange.Rows.Count
Range("B1").Select
ActiveCell.FormulaR1C1 = "=HYPERLINK(RC[-1])"
Range("B1").Select
Selection.AutoFill Destination:=Range("B1:B" & x), Type:=xlFillDefault
End Sub

Hope this helps.

"GrubbyG" wrote:

I would like to link .pdf files to an excel file. Within my excel file I
would like to have a column that has file names in it. Then have excel link
those files to the excel file so when I print the excel file all the linked
files print along with it.

Reply
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
Link Excel 2007 file to 2003 files Chrisp Excel Discussion (Misc queries) 3 July 17th 08 12:08 PM
Can I find what files link into a source file in Excel? KWBPAB Excel Worksheet Functions 1 May 21st 07 04:25 PM
CHK file in excel link files srinivasan Excel Worksheet Functions 1 November 7th 05 08:40 PM
Can I embed or link multiple .pdf files into or to an excel file? GrubbyG Excel Discussion (Misc queries) 1 October 3rd 05 08:40 PM
Link and embed pdf into excel nielsencj Links and Linking in Excel 0 May 20th 05 07:19 PM


All times are GMT +1. The time now is 01:16 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"