Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
  2. Dim testo As String
  3. Dim nomefile As String
  4. Dim path As String
  5.  
  6. On Error Resume Next
  7.  
  8. If Target.Column = 5 Then
  9.  
  10. path = "C:UsersAlex"
  11. testo = path & Cells(Target.Row, 5)
  12. nomefile = Dir(Left(testo, Len(testo)) & "*.pdf")
  13.  
  14. If nomefile = "" Then
  15. MsgBox "File non trovato", vbCritical, "ATTENZIONE"
  16. Exit Sub
  17. End If
  18.  
  19. Do
  20. Shell "C:Program Files (x86)AdobeReader 11.0ReaderAcroRd32.exe " & path & nomefile, vbMaximizedFocus
  21. nomefile = Dir
  22. Loop While nomefile <> ""
  23. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement