Attribute VB_Name = "modMain" Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long _ ) As Long Public Sub OpenPDF(filePath As String) Dim result As Long result = ShellExecute(0, "open", filePath, vbNullString, vbNullString, 1) If result <= 32 Then MsgBox "Failed to open PDF. Error code: " & result End If End Sub