Import .pdf ...?
Solved/Closed
RickRoll
-
Updated on Mar 28, 2017 at 05:13 PM
RickRoll Posts 1 Registration date Tuesday March 28, 2017 Status Member Last seen April 12, 2017 - Apr 12, 2017 at 03:48 AM
RickRoll Posts 1 Registration date Tuesday March 28, 2017 Status Member Last seen April 12, 2017 - Apr 12, 2017 at 03:48 AM
Related:
- Import .pdf ...?
- Save as pdf office 2007 - Download - Other
- Import sim contacts - Guide
- Pdf xchange presentation mode - Guide
- Pdf wiederherstellen - Guide
- Cute pdf - Download - PDF
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Mar 30, 2017 at 11:35 AM
Mar 30, 2017 at 11:35 AM
Hi Rick,
The following code has been adjusted to work with pdf files as well as the dummy-proof part. Remove code line 18 when you don't like a message to show.
Best regards,
Trowa
The following code has been adjusted to work with pdf files as well as the dummy-proof part. Remove code line 18 when you don't like a message to show.
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("D5")) Is Nothing Then Exit Sub Application.DisplayAlerts = False 'this will prevent an alert when filename is not found ActiveSheet.OLEObjects.Delete 'deletes previously inserted .pdf If Target.Value = vbNullString Then Exit Sub On Error GoTo ErrorMessage Range("I7").Select ActiveSheet.OLEObjects.Add(Filename:="C:\Users\Henri\Pictures\" & _ Target & ".pdf", Link:=False, DisplayAsIcon:=False).Select Application.DisplayAlerts = True 'enables alerts again when filename is found ErrorMessage: Application.DisplayAlerts = True 'enables alerts again when filename is not found MsgBox "File not found", vbInformation 'this displays a message to inform the user End Sub
Best regards,
Trowa
Apr 12, 2017 at 03:48 AM
Your code works perfectly!
Happy Days!:)