Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shell command and Notepad | Excel Programming | |||
Shell Command | Excel Programming | |||
Shell command | Excel Programming | |||
xp shell command using vba | Excel Programming | |||
SHELL command | Excel Programming |