Shell iexplore.exe xml #

johnbird1988

Board Regular
Joined
Oct 6, 2009
Messages
199
Hello,

I have the following code below:
Code:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim URL As String
On Error GoTo error4:
URL = Me.ListBox1.Column(5, Me.ListBox1.ListIndex)
    Shell "C:\Program Files\Internet Explorer\iexplore.exe " & URL, vbNormalNoFocus
    
Exit Sub
error4:
MsgBox ("Link unavailable")
End Sub

This code did work, however the URL has now changed to include a # to a specific area on a page. My URL now looks something like this:
Code:
URL= "http://myteamsite/sites/info_team/area/folder/folder%20Diagrams/subfolder/Items/File%20Name%20Test.xml#This is the location"

When I run the code above it replaces the spaces after the # with %20. This causes the screen not to navigate to the correct location on the page. Is there any way I can achieve this to navigate to the correct location?

Cheers,

John
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi,

you could try adding another line before the shell command to replace the %20 with a space

Code:
URL = Replace(URL, "%20", " ")
 
Upvote 0
Hi,

Overlooked......
When you pass a URL to a browser if it has spaces then it will fill those with %20 anyway. An anchor link should still work though.
 
Upvote 0

Forum statistics

Threads
1,216,730
Messages
6,132,395
Members
449,725
Latest member
Enero1

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