I am working on having a sheet allow you to select PDF files from your computer and attach those files to the sheet and then send off the sheet. It does attach however when sending the file out to someone else the file is lost because that file remains on that local computer. Below is the code I am using. I am attaching using a button which activates the VBA and allows the user to attach the file(s)
ideally what i would like is something like this
Attach file (button)
user selects file...
generic icon showing it attached to file
Another button attach additional files.
And so on...
-------------------------------------------------------------------------------------------------------------
Sub insert()
Dim ftopen As Variant
'get file name from open file dialog box.
ftopen = Application.GetOpenFilename(FileFilter:="Adobe Acrobat(*.PDF),*.xls", Title:="DDTS Adobe Acrobat")
'if no file chosen then close sub
If ftopen = False Then
MsgBox ("No file chosen")
Exit Sub
End If
On Error Resume Next
'insert file into sheet.
ActiveSheet.OLEObjects.Add(Filename:=ftopen, Link:=False, _
DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{AC76BA86-7AD7-1033-7B44-AA1000000001}\PDFFile_8.ico", _
IconIndex:=0, IconLabel:=0).Activate
End Sub
ideally what i would like is something like this
Attach file (button)
user selects file...
generic icon showing it attached to file
Another button attach additional files.
And so on...
-------------------------------------------------------------------------------------------------------------
Sub insert()
Dim ftopen As Variant
'get file name from open file dialog box.
ftopen = Application.GetOpenFilename(FileFilter:="Adobe Acrobat(*.PDF),*.xls", Title:="DDTS Adobe Acrobat")
'if no file chosen then close sub
If ftopen = False Then
MsgBox ("No file chosen")
Exit Sub
End If
On Error Resume Next
'insert file into sheet.
ActiveSheet.OLEObjects.Add(Filename:=ftopen, Link:=False, _
DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{AC76BA86-7AD7-1033-7B44-AA1000000001}\PDFFile_8.ico", _
IconIndex:=0, IconLabel:=0).Activate
End Sub