Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA shell command - issues...


The VBA shell command is as follows:

programPath = "C:\Program Files\Internet Explorer\iexplore.exe" '
works
'programPath = "iexplore.exe" ' does not work
Shell programPath + " " + fileToLaunch, vbNormalFocus

but the drawback is that the invoked program (iexplore.exe, at least in
my case) needs to have the FULL PATH to where the program exists = the
"C:\Program Files\Internet Explorer" which may or may not work on
someone elses computer. This hardcoding will not work and is not
transportable.

Is there a trick to find where the executing program lives? or
launching it without the path?

Thanks,


--
JWM6
------------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413
View this thread: http://www.excelforum.com/showthread...hreadid=532972

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VBA shell command - issues...

Try

Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
MsgBox IE.FullName
IE.Quit
Set IE = Nothing


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"JWM6" wrote
in message
...

The VBA shell command is as follows:

programPath = "C:\Program Files\Internet Explorer\iexplore.exe"
'
works
'programPath = "iexplore.exe" ' does not work
Shell programPath + " " + fileToLaunch, vbNormalFocus

but the drawback is that the invoked program (iexplore.exe, at
least in
my case) needs to have the FULL PATH to where the program
exists = the
"C:\Program Files\Internet Explorer" which may or may not work
on
someone elses computer. This hardcoding will not work and is
not
transportable.

Is there a trick to find where the executing program lives? or
launching it without the path?

Thanks,


--
JWM6
------------------------------------------------------------------------
JWM6's Profile:
http://www.excelforum.com/member.php...o&userid=33413
View this thread:
http://www.excelforum.com/showthread...hreadid=532972



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default VBA shell command - issues...

JWM6

This works

Sub OpenIE()

Dim ieApp As Object

Set ieApp = CreateObject("InternetExplorer.Application")

ieApp.Visible = True

Set ieApp = Nothing

End Sub

--
Dick Kusleika
MS MVP - Excel
www.dailydoseofexcel.com

JWM6 wrote:
The VBA shell command is as follows:

programPath = "C:\Program Files\Internet Explorer\iexplore.exe" '
works
'programPath = "iexplore.exe" ' does not work
Shell programPath + " " + fileToLaunch, vbNormalFocus

but the drawback is that the invoked program (iexplore.exe, at least
in my case) needs to have the FULL PATH to where the program exists =
the "C:\Program Files\Internet Explorer" which may or may not work on
someone elses computer. This hardcoding will not work and is not
transportable.

Is there a trick to find where the executing program lives? or
launching it without the path?

Thanks,



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA shell command - issues...


Thanks for the replies, will give it a shot..

--
JWM
-----------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...fo&userid=3341
View this thread: http://www.excelforum.com/showthread.php?threadid=53297

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA shell command - issues...


Works great - thanks!


--
JWM6
------------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413
View this thread: http://www.excelforum.com/showthread...hreadid=532972



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA shell command - issues...


So I wanted to bat this idea around but I'll give some context...

I'm in Excel doing some stuff, then I use the VBA shell command to
launch IE and siaply stuff in the IE frame. What I'd like to happen is
I get control returned to my Excel app (underneath the IE shelled
window) after the IE window is closed.

Any way to keep the Excel app from coming to the front and things
continuing while the IE window is up? Then when the IE window is
dismissed, I can unblock and give control back to the Excel app...

Thanks,


--
JWM6
------------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413
View this thread: http://www.excelforum.com/showthread...hreadid=532972

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default VBA shell command - issues...

JWM6 wrote:
So I wanted to bat this idea around but I'll give some context...

I'm in Excel doing some stuff, then I use the VBA shell command to
launch IE and siaply stuff in the IE frame. What I'd like to happen
is I get control returned to my Excel app (underneath the IE shelled
window) after the IE window is closed.

Any way to keep the Excel app from coming to the front and things
continuing while the IE window is up? Then when the IE window is
dismissed, I can unblock and give control back to the Excel app...

Thanks,


JWM

I don't know if I particularly like this solution, but it's all I've got.
It checks to see if ieApp is visible every 10 seconds (change to suit) and
displays a message box when it's gone. I'm using early binding here (my
last post was late bound, I think) so you'll have to set a reference to
Microsoft Internet Controls or convert to late bound.

Public ieApp As InternetExplorer
Public Const dINTER As Double = 1.15740740740741E-04 '10 seconds

Sub WaitForIe()

Dim sUrl As String

Set ieApp = New InternetExplorer

ieApp.Visible = True
ieApp.Navigate "http://www.dailydoseofexcel.com"

Application.OnTime Now + dINTER, "CloseIE"

End Sub

Sub CloseIE()

Dim bVis As Boolean

bVis = False
On Error Resume Next
bVis = ieApp.Visible
On Error GoTo 0

If bVis Then
Application.OnTime Now + dINTER, "CloseIE"
Else
Set ieApp = Nothing
MsgBox "IE Closed"
End If

End Sub

--
Dick Kusleika
MS MVP - Excel
www.dailydoseofexcel.com


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell command and Notepad SA3214 Excel Programming 1 May 15th 05 11:57 AM
Shell Command JOHN Excel Programming 1 November 17th 04 10:39 AM
Shell command MAx Excel Programming 2 June 4th 04 04:11 PM
xp shell command using vba Sudhendra Excel Programming 2 February 16th 04 05:56 AM
SHELL command Robin Clay[_3_] Excel Programming 3 October 17th 03 02:50 PM


All times are GMT +1. The time now is 11:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"