security/error prompt

nichmeg

New member
Local time
Today, 09:27
Joined
Nov 8, 2011
Messages
1
I am getting the following pop up (see error.jpg). I am using the following code to open files on the server, and want to know how to keep it from asking.prompting this every time. Is there a better way to code it to prevent this, or is it unavoidable?

Code:
Private Sub pfp1button_Click()
    Dim strLinkUrl As String
    Dim strPath As String
    Dim strAddr() As String
        strPath = "G:/Fire/Private/PDF PFP/"
        strLinkUrl = [Pre-Plan #] & ".pdf"
         
        strAddr = Split(strLinkUrl, "", , vbTextCompare)
        strLinkUrl = ""
            For i = LBound(strAddr()) To UBound(strAddr())
            strLinkUrl = strLinkUrl & strAddr(i) & "+"
            Next i
         
        strLinkUrl = strPath & Left(strLinkUrl, Len(strLinkUrl) - 1)
            Debug.Print strLinkUrl
                Me.pfp1button.HyperlinkAddress = strLinkUrl
End Sub
I am really stumped by this, I can get it to open the files, but it uses internet explorer (however Adobe is the default for pdfs if you double click the file). I was hoping there was a generic way of doing this as it will be put on a few computers and I dont know if the install directory is the same for telling it to use c:/program files/...../acrobat.exe to open the file.
Ill attach the file, but I dont how anyone could test it as the link is on the server.
I dont know if part of the problem is me telling it to go to "G:/Fire/Private/PDF PFP/" + the pre-plan # + ".pdf"
I tested to see if it would work and had a msgbox pop up with the output file and it is telling it the right file name. I put that in the run box of the start menu and it opens the file fine in adobe. tell it to open via access and it opens in internet explorer.
I was using the same basis as the aerial map (which works fine) but keep getting this security box. Ive tried it on 3 computers too to make sure it wasnt some extra security feature that was on the computer.
Hopefully that is a little clearer than mud.
Thanks

PS - Ive also tried the application.followhyperlink with no success either.
 

Attachments

  • error.JPG
    error.JPG
    18.8 KB · Views: 154
  • Pre-Plansv2.22a.zip
    Pre-Plansv2.22a.zip
    383.9 KB · Views: 157
Not sure how to fix your specific issue, but a work around is to create an AutoIt script that opens the file then clicks the ok button for you. http://www.autoitscript.com/site/

You can compile the script then get you code to run that.
 

Users who are viewing this thread

Back
Top Bottom