Hello all,
I'm sure this will be a simple fix, but I'm a bit stuck on something.
I've built a dashboard tool that amougsnt other things displays a pdf image (of a store plan) in a web browser control.
The user simply selects the particular shop they want to view from a drop down list in cell C3.
The store names in the drop down are all in the same format. (Unique four digit number, space, store name)
e.g.
4600 ABERDARE
4147 ADEL
All the pdf's are stored in one folder and are saved as just the store name. e.g. \\uknts8005\cad\store planning\dashboard\PLAN PDF\ABERDARE.pdf
This is the code used to display the correct pdf, and it works perfectly. Assuming there is a pdf.
Formula:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C3")) Is Nothing Then
Me.WebBrowser2.Navigate "\\uknts8005\cad\store planning\dashboard\PLAN PDF\" & Trim(Mid(Target.Value, 5, 1000)) & ".pdf"
End If
End Sub
The problem is when the pdf is missing or spelled incorrectly. It will display this message where the pdf should be:
no-pdf.jpg
What I'd like is to display a custom message on a pdf if the store plan isn't found.
Lets say the location is: \\uknts8005\cad\store planning\dashboard\PLAN PDF\ErrorMsg.pdf
How can I get it to naviagte to the error pdf only when the orginal pdf isnt found?
Everything I've tried just makes the error pdf show all the time, no matter what!
Thanks
Bookmarks