Standard Message box to Stylish box

kamranyd

Board Regular
Joined
Apr 24, 2018
Messages
152
Office Version
  1. 2021
Platform
  1. Windows
Hi to all, I have these codes which shows error if the value not found, if it found it will open pdf file taking value from cell, is there any way to make this standard message box to stylish box where text has color and are bold and I can add pictures. I search on google about userform to create fancy message boxes but didn't get the proper method to get these codes in userform and work same like they work now.

VBA Code:
Sub quot_PDF_File()
    
    Dim FileNameRef As String, myPath As String, Prompt As String

    FileNameRef = Application.WorksheetFunction.Text(Range("B10"), "0000")
       myPath = "D:\"

    On Error Resume Next
    ThisWorkbook.FollowHyperlink myPath & FileNameRef
    
        If Err.Number <> 0 Then
    Prompt = "Quotation Number [-]> " & FileNameRef & ".pdf <[-]" & vbNewLine & vbNewLine & _
    "NOT FOUND IN BELOW LOCATION" & vbNewLine & vbNewLine & _
    "Click to explore folder location" & vbNewLine & vbNewLine & "D:\"
  
    Const TITLE = "PDF file Search & Open"
    Const BUTTONS = vbExclamation
            
    Dim lRet As VbMsgBoxResult
    Dim sLinksArray(0 To 0, 1) As String
  
    sLinksArray(0, 0) = "D:\":            sLinksArray(0, 1) = "D:\"
    
    lRet = HyperlinkMsgBox(Prompt, sLinksArray, BUTTONS, TITLE)
  End If
End Sub
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top