View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jeroen Kluytmans Jeroen Kluytmans is offline
external usenet poster
 
Posts: 9
Default Browse and attach file in a UserForm

Hello,

I would like to make an option in a userform to browse a file and add
it to the excel sheet. I don't have a clue how to make this. Can
anybody help me with a start?

So far I can open a file, but I can not manage to just make a linkt to
the object, or load the file as object in the excel file. It would be
best if the link to the file or the object can be copied in a cell in
the worksheet.

Private Sub CommandButton2_Click()

Dim TheFile As Variant
TheFile = Application.GetOpenFilename("Excel files (*.xls), *.xls", ,
_
"Pick a file")
If TheFile < False Then
Workbooks.Open TheFile
End If
End Sub

Any help welcome
Kind regards,
Jeroen Kluytmans