PC Review


Reply
Thread Tools Rate Thread

Can't launch Internet Explorer

 
 
Adrian D. Bailey
Guest
Posts: n/a
 
      14th Nov 2006
I have a VBmacro that writes some webpages.
I want the last line of the macro to launch a browser to display the first
of the pages.

I've tried this...
dummy = Shell("iexplore " & Environ("temp") & "\showpeople1.htm",
vbNormalFocus)
....but I get File Not Found.

Oddly, if I replace "iexplore" with "notepad" it works, with Notepad
launching and showing me the HTML code.

Ideally, I'd like to launch the user's default browser - whether that's IE,
or Firefox or whatever.

Any tips, please?
--
Adrian D.Bailey, Information and Systems Manager, Dept.Human Sciences
Loughborough University, Loughborough Leics, LE11 3TU, UK.
(E-Mail Removed) Tel: 01509 223007 Fax: 01509 223940

Community Warden, Storer and Burleigh Areas. Out-of-hours Tel: 01509 563263
--


 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      14th Nov 2006
Have a go with this to launch in deafult browser

Public Declare 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 Long

Public Declare Function GetDesktopWindow Lib "user32" () As Long

Sub Test()
Dim hWndDesk As Long
Dim res&
Dim sFile$

sFile = Environ("temp") & "\" & "myFile.htm"
hWndDesk = GetDesktopWindow()

res = ShellExecute(hWndDesk, vbNullString, sFile, _
vbNullString, vbNullString, vbNormalFocus)

Debug.Print res
Select Case res
Case Is > 32
' should be up & running
Case 2
'file not found
Case Else
'some other error specific to res
End Select

End Sub

Might also need something along the lines of ShellAndWait, search google for
other error codes.

Regards,
Peter T

"Adrian D. Bailey" <(E-Mail Removed)> wrote in message
news:ejc67u$bn6$(E-Mail Removed)...
> I have a VBmacro that writes some webpages.
> I want the last line of the macro to launch a browser to display the first
> of the pages.
>
> I've tried this...
> dummy = Shell("iexplore " & Environ("temp") & "\showpeople1.htm",
> vbNormalFocus)
> ...but I get File Not Found.
>
> Oddly, if I replace "iexplore" with "notepad" it works, with Notepad
> launching and showing me the HTML code.
>
> Ideally, I'd like to launch the user's default browser - whether that's

IE,
> or Firefox or whatever.
>
> Any tips, please?
> --
> Adrian D.Bailey, Information and Systems Manager, Dept.Human Sciences
> Loughborough University, Loughborough Leics, LE11 3TU, UK.
> (E-Mail Removed) Tel: 01509 223007 Fax: 01509 223940
>
> Community Warden, Storer and Burleigh Areas. Out-of-hours Tel: 01509

563263
> --
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Launch Internet Explorer Judy Windows XP Internet Explorer 2 28th Mar 2004 07:36 PM
Re: launch internet explorer in c# Nicholas Paldino [.NET/C# MVP] Microsoft C# .NET 0 7th Jan 2004 02:54 PM
Windows Explorer and Internet Explorer won't launch Swede Windows XP Performance 0 3rd Jan 2004 06:06 PM
Unable to launch Windows Explorer or Internet Explorer Jay Windows XP Performance 1 29th Dec 2003 12:23 PM
Internet Shortcuts (.url files) wont launch internet explorer Conor McCartney Microsoft Windows 2000 Upgrade 3 24th Aug 2003 07:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:13 PM.