Okay so I have an Excel database that uses a form to lookup values in a table and based on the value gets a file path.

The issue is that the files were originally all .doc files. I used the following code to open them:

VB Code:
  1. Public Function OpenFile(strfile As String)
  2.      Dim x As Variant
  3.      'call word to the program
  4.      'C:\WINDOWS\SYSTEM32\WINWORD.exe
  5.      x = Shell("WINWORD.exe " & strfile, 1)
  6. End Function
VB Code:
  1. Private Sub OpenButton_Click()
  2. 'set the sheet
  3. Set Sheet = ActiveWorkbook.Worksheets("DCA_Data")
  4. Dim strfile As String
  5.  
  6. If listi = 0 Then
  7.     'error if nothing is selected
  8.     response = MsgBox("No Value Selected", 0, "No Values")
  9. Else
  10.     'call the path
  11.     strfile = Sheet.Cells(listi, 4)
  12.     'open the path
  13.     OpenFile (strfile)
  14. End If
  15. End Sub

It is now required that I open the files as PDFs. I have converted all of the files and have updated the tables. I need to modify this code so that it opens the PDF using the computer's default application. This file will be on a server so many different computers have access to it. This means that different versions and programs may be being used. Any help would be much appreciated. Thanks.