Followhyperlink alternate (1 Viewer)

John Sh

Member
Local time
Today, 22:23
Joined
Feb 8, 2021
Messages
410
After having problems with followhyperlink I searched the net and found this site https://stackoverflow.com/questions/66698889/open-links-using-vba-without-followhyperlink.
I installed the software and tried again with the same result, which is;
In development mode, access 2016 64bit and w10, the software runs without error.
If I then compile to accde and run within the Access window, again no probems.
Running the software from a shortcut with windows minimised or running the accde direct is when I have trouble.
I am opening an HTTPS file that runs a 3D demo. after closing the file the "Next" button is called but does not operate. Instead I get a message indicating I can't go to a new record while in design view.
Click ok on this message and operation returns to normal until I call another 3D image.

Screenshot_54.jpg


The only event in the btnnext is "Onclick" and there are no validation rules, it is simply docmd.gotorecord,,acnext

Sample url's

Code:
Public Declare PtrSafe 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 LongPtr

Public Sub OpenURL(str As String)
   ShellExecute 0&, vbNullString, str, vbNullString, vbNullString, 5
End Sub


 sPath = Me.txtPhotoNum
            OpenURL (sPath)
            strMessage = "Please close the 3D window before selecting the next image!"
            strImage = "C"
            bOK = True
            Messenger
            btnNext_Click
            Exit Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:23
Joined
May 7, 2009
Messages
19,245
these are alternative:

Shell "explorer.exe " & sPath

or

CreateObject("Shell.Application").NameSpace(0).ParseName(sPath).InvokeVerb "Open"
 

John Sh

Member
Local time
Today, 22:23
Joined
Feb 8, 2021
Messages
410
these are alternative:

Shell "explorer.exe " & sPath

or

CreateObject("Shell.Application").NameSpace(0).ParseName(sPath).InvokeVerb "Open"
Thank you but they both behave in the same way. Is it possible that the 3D imagery is having some effect?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:23
Joined
May 7, 2009
Messages
19,245
Thank you but they both behave in the same way.
i don't have problem opening both. there was no error or message. it just open on the edge browser.
 

John Sh

Member
Local time
Today, 22:23
Joined
Feb 8, 2021
Messages
410
i don't have problem opening both. there was no error or message. it just open on the edge browser.
I just tried it with a couple of short image links with the same result. Debug thinks it's all good but there must be some obscure thing causing it.
I'll put some stand alone procedures together and see if I can track it down that way.
Once again, many thanks for your input.
John
 

cheekybuddha

AWF VIP
Local time
Today, 13:23
Joined
Jul 21, 2014
Messages
2,280
Ah, I see.

Looks like you might have to decompile.

1. Compact and repair your db.
2. Close it.
3. Open it with decompile switch.
4. C&R again.
5. Open code editor
6. Debug menu -> Compile
7. C&R again
8. Try your code again
 

John Sh

Member
Local time
Today, 22:23
Joined
Feb 8, 2021
Messages
410
Ah, I see.

Looks like you might have to decompile.

1. Compact and repair your db.
2. Close it.
3. Open it with decompile switch.
4. C&R again.
5. Open code editor
6. Debug menu -> Compile
7. C&R again
8. Try your code again
I'll give it a try.
I ran the code today on two w11 machines and there was no problem other than on one machine the entire software froze after left unattended for a while. Stopped the program with task manager, restarted it and went through the 3D images without a hitch.
Somebody once said "Access does some weird things", this is one of them!
 

Users who are viewing this thread

Top Bottom