Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Call other application from excel

Hi,

I am using Shell ("c:\Program Files\X\X.EXE") to run another program from
excel , now how can I make this code to open a specific file for me actually
in this case both excel and X application are using the same file name but
the extensions are like 04094.xls and 04094.XXX .

Thanks in advance.
Afshin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Call other application from excel

Not sure I fully understand what you are trying to achieve. maybe this will
help you:

fileOpen = Shell("notepad.exe " & fileName, vbMaximizedFocus)

or

if you want to use an office application you may look at this (Activating
Other Applications with Excel VBA section):
http://www.geocities.com/jonpeltier/Excel/XL_PPT.html

regards,
KL


"A-Design" wrote in message
...
Hi,

I am using Shell ("c:\Program Files\X\X.EXE") to run another program from
excel , now how can I make this code to open a specific file for me
actually in this case both excel and X application are using the same
file name but the extensions are like 04094.xls and 04094.XXX .

Thanks in advance.
Afshin



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Call other application from excel

If I understand correctly you are asking about this:

fileOpen = Shell("c:\Program Files\X\X.EXE " & "c:\myfolder\04094.XXX",
vbMaximizedFocus)

KL


"KL" wrote in message
...
Not sure I fully understand what you are trying to achieve. maybe this
will help you:

fileOpen = Shell("notepad.exe " & fileName, vbMaximizedFocus)

or

if you want to use an office application you may look at this (Activating
Other Applications with Excel VBA section):
http://www.geocities.com/jonpeltier/Excel/XL_PPT.html

regards,
KL


"A-Design" wrote in message
...
Hi,

I am using Shell ("c:\Program Files\X\X.EXE") to run another program from
excel , now how can I make this code to open a specific file for me
actually in this case both excel and X application are using the same
file name but the extensions are like 04094.xls and 04094.XXX .

Thanks in advance.
Afshin





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Call other application from excel

That is it,
Thank you KL,


"KL" wrote in message
...
If I understand correctly you are asking about this:

fileOpen = Shell("c:\Program Files\X\X.EXE " & "c:\myfolder\04094.XXX",
vbMaximizedFocus)

KL


"KL" wrote in message
...
Not sure I fully understand what you are trying to achieve. maybe this
will help you:

fileOpen = Shell("notepad.exe " & fileName, vbMaximizedFocus)

or

if you want to use an office application you may look at this (Activating
Other Applications with Excel VBA section):
http://www.geocities.com/jonpeltier/Excel/XL_PPT.html

regards,
KL


"A-Design" wrote in message
...
Hi,

I am using Shell ("c:\Program Files\X\X.EXE") to run another program
from excel , now how can I make this code to open a specific file for me
actually in this case both excel and X application are using the same
file name but the extensions are like 04094.xls and 04094.XXX .

Thanks in advance.
Afshin







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Call other application from excel


Can either of you tell me how I would use shell to accomplish this task
I have macro's that have been created via VB in EXCEL - I have been
asked to 'add' to the macro a method of notification - I know I can
do the below command via a
DOS prompt

net send 157.159.99.123 hi this is the message I am sending
net send 157.159.99.124 you to also need to recv a message

I would like to find a way to send a message such as those above to
'specific IPs ' on my net work with in the macro

is this possible? (I do not need to use the exact command as shown
above but I do need it sent to either the IP or a group )



"A-Design" wrote:

That is it,
Thank you KL,


"KL" wrote in message
...
If I understand correctly you are asking about this:

fileOpen = Shell("c:\Program Files\X\X.EXE " & "c:\myfolder\04094.XXX",
vbMaximizedFocus)

KL


"KL" wrote in message
...
Not sure I fully understand what you are trying to achieve. maybe this
will help you:

fileOpen = Shell("notepad.exe " & fileName, vbMaximizedFocus)

or

if you want to use an office application you may look at this (Activating
Other Applications with Excel VBA section):
http://www.geocities.com/jonpeltier/Excel/XL_PPT.html

regards,
KL


"A-Design" wrote in message
...
Hi,

I am using Shell ("c:\Program Files\X\X.EXE") to run another program
from excel , now how can I make this code to open a specific file for me
actually in this case both excel and X application are using the same
file name but the extensions are like 04094.xls and 04094.XXX .

Thanks in advance.
Afshin










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Call other application from excel

Kathy

you could try the shellwait function
(not fully tested)
RetVal = Shell("command.com /c nbtstat -a " & sMachineID , 0)
based on the snippet of code that does/did work:
RetVal = Shell("command.com /c nbtstat -a " & sMachineID & " " &
Environ$("temp") & "\" & sMachineID & ".txt", 0)

hth

Tim

the shellwait code is reproduced below incl a dummy test (put code in its
own module for convenience):

Option Explicit

Private Const PROCESS_QUERY_INFORMATION As Long = &H400
Private Const STILL_ACTIVE As Long = &H103

Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess
As _
Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long

Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess
As _
Long, lpExitCode As Long) As Long


Sub TestShellAndWait()
Dim Ret_Val_

ShellAndWait ("command.com /c dir s: c:\temp\junk.txt")
'ShellAndWait ("command.com dir c:\*.* c:\temp\junk.txt")

End Sub

''' Arguments: szCommandLine The command line to execute using Shell.
''' iWindowState (Optional) The window state parameter to
pass
''' to the Shell function. Default = vbHide.
''' See Shell function help for other options.
Sub ShellAndWait(ByVal szCommandLine As String, Optional ByVal iWindowState
As _
Integer = vbHide)

Dim lTaskID As Long
Dim lProcess As Long
Dim lExitCode As Long
Dim lResult As Long

''' Run the Shell function.
lTaskID = Shell(szCommandLine, iWindowState)

''' Get the process handle from the task ID returned by Shell.
lProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 0&, lTaskID)

''' Loop while the shelled process is still running.
Do
''' lExitCode will be set to STILL_ACTIVE as long as the shelled
process is running.
lResult = GetExitCodeProcess(lProcess, lExitCode)
DoEvents
Loop While lExitCode = STILL_ACTIVE

End Sub






"Kathy" wrote in message
...

Can either of you tell me how I would use shell to accomplish this task
I have macro's that have been created via VB in EXCEL - I have been
asked to 'add' to the macro a method of notification - I know I can
do the below command via a
DOS prompt

net send 157.159.99.123 hi this is the message I am sending
net send 157.159.99.124 you to also need to recv a message

I would like to find a way to send a message such as those above to
'specific IPs ' on my net work with in the macro

is this possible? (I do not need to use the exact command as shown
above but I do need it sent to either the IP or a group )



"A-Design" wrote:

That is it,
Thank you KL,


"KL" wrote in message
...
If I understand correctly you are asking about this:

fileOpen = Shell("c:\Program Files\X\X.EXE " &

"c:\myfolder\04094.XXX",
vbMaximizedFocus)

KL


"KL" wrote in message
...
Not sure I fully understand what you are trying to achieve. maybe

this
will help you:

fileOpen = Shell("notepad.exe " & fileName, vbMaximizedFocus)

or

if you want to use an office application you may look at this

(Activating
Other Applications with Excel VBA section):
http://www.geocities.com/jonpeltier/Excel/XL_PPT.html

regards,
KL


"A-Design" wrote in message
...
Hi,

I am using Shell ("c:\Program Files\X\X.EXE") to run another program
from excel , now how can I make this code to open a specific file

for me
actually in this case both excel and X application are using the

same
file name but the extensions are like 04094.xls and 04094.XXX .

Thanks in advance.
Afshin










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Call other application from excel

KL,
Have you tried this on your system ? Is it working for you ? please see my
2nd post that I have sent yesterday.
Thanks,
Afshin


"KL" wrote in message
...
If I understand correctly you are asking about this:

fileOpen = Shell("c:\Program Files\X\X.EXE " & "c:\myfolder\04094.XXX",
vbMaximizedFocus)

KL


"KL" wrote in message
...
Not sure I fully understand what you are trying to achieve. maybe this
will help you:

fileOpen = Shell("notepad.exe " & fileName, vbMaximizedFocus)

or

if you want to use an office application you may look at this (Activating
Other Applications with Excel VBA section):
http://www.geocities.com/jonpeltier/Excel/XL_PPT.html

regards,
KL


"A-Design" wrote in message
...
Hi,

I am using Shell ("c:\Program Files\X\X.EXE") to run another program
from excel , now how can I make this code to open a specific file for me
actually in this case both excel and X application are using the same
file name but the extensions are like 04094.xls and 04094.XXX .

Thanks in advance.
Afshin







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
Call Application.Volatile(True) NOT WORKING FARAZ QURESHI Excel Discussion (Misc queries) 1 May 8th 08 04:50 AM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
COM-call-in to Excel John Kessel Excel Programming 1 November 6th 04 10:11 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
application.quit will not shut off application john Excel Programming 0 January 9th 04 11:29 PM


All times are GMT +1. The time now is 03:31 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"