Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open an URL file using IE using VBA

Status
Not open for further replies.
Sep 19, 2003
4
CA
I copied this via IE shortcut property's URL :

It's long..more than 1300 characters. Insert Hyperlink and object doesn't work bacause of 256 chars limitation.

I tried to launch the saved query file using this code(.111 is assocaiated with IE)

Shell("C:\Program Files\Internet Explorer\iexplore.exe C:\temp\2007.111")

and error message says "Cannot find 'File:///c:\temp\2007.111'. Make sure path or internet address is correct"

Yet when I dbl-click the file from Windows Explorer, it is working fine.

Please help. Thanks.
 
What about this ?
CreateObject("WScript.Shell").Run "C:\temp\2007.111"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

Thanks PHV

Pasted code and Got Run time error message :

Method 'Run' of obj 'IWshShell3' failed

I'll try again tomorrow.
 
ChanTheManCan,
Create your own IE object then navigate to the URL?
Code:
Const cURL As String = "[URL unfurl="true"]https://intranet05.companyname.com/ibi_apps/..."[/URL]

Sub TestIT()
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate cURL
objIE.Visible = True
Set objIE = Nothing
End Sub

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top