Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old September 16th 06, 09:26 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2006
Posts: 7
Default Shell to another program from Excel

I am trying to shell to an Image viewing program from Excel by using the
following line of code:
Windows(1).WindowState = xlMinimized
ReturnValue = Shell(ImgViewer, 3)

Where ImgViewer is a string containg the path and filename of the program to
be executed.
Excel minimises but immediately returns to full screen
I have inserted a msgbox to trap the ReturnValue and it displays whilst
Excel is minimised but the image viewing program does not appear to be
running
On closing the msgbox Excel returns to normal

What have I done wrong ?

Ultimately I will want to append a variable to the ImageViewer string to
pass command line switches to the program e.g.
ReturnValue = Shell(ImgViewer &" " & Filename, 3)
Is this possible ?



  #2   Report Post  
Old September 17th 06, 02:57 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2006
Posts: 78
Default Shell to another program from Excel

Hi Jimbo,

Have done something along similar lines which may be adaptable (?)

RetValBmp = Shell(Directory & "img.bat", vbNormalFocus)

The directory is the path to the batch file (e.g. d:\myapp\) (where the xls
file and the image viewer i_view32.exe are also kept).
The batch file contains:
d:
cd d:\myapp\
i_view32.exe .\*.jpg /convert=.\*.bmp

It converts jpg image(s) in that directory to bmp.

Hope this (and/or further posts) may be of help

Anthony

"Jimbo" wrote:

I am trying to shell to an Image viewing program from Excel by using the
following line of code:
Windows(1).WindowState = xlMinimized
ReturnValue = Shell(ImgViewer, 3)

Where ImgViewer is a string containg the path and filename of the program to
be executed.
Excel minimises but immediately returns to full screen
I have inserted a msgbox to trap the ReturnValue and it displays whilst
Excel is minimised but the image viewing program does not appear to be
running
On closing the msgbox Excel returns to normal

What have I done wrong ?

Ultimately I will want to append a variable to the ImageViewer string to
pass command line switches to the program e.g.
ReturnValue = Shell(ImgViewer &" " & Filename, 3)
Is this possible ?



  #3   Report Post  
Old September 17th 06, 09:30 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2006
Posts: 7
Default Shell to another program from Excel

Thanks for the input Anthony,
I'm not sure that I can use your method because the workbook will be used on
a number of different pcs with different image viewing programs.
With the assistance of others in this newsgroup I have managed to write the
code to identify the default image viewing program i.e. the file associated
with opening an image file. This is stored in the variable ImgViewer.
If I understand your approach correctly individual batch files would be
required and would need updating if/when different image viewing programs
were installed.
Nevertheless I thank you for your suggestion.

Regards
Jim Burton

"Anthony D" wrote in message
...
Hi Jimbo,

Have done something along similar lines which may be adaptable (?)

RetValBmp = Shell(Directory & "img.bat", vbNormalFocus)

The directory is the path to the batch file (e.g. d:\myapp\) (where the
xls
file and the image viewer i_view32.exe are also kept).
The batch file contains:
d:
cd d:\myapp\
i_view32.exe .\*.jpg /convert=.\*.bmp

It converts jpg image(s) in that directory to bmp.

Hope this (and/or further posts) may be of help

Anthony

"Jimbo" wrote:

I am trying to shell to an Image viewing program from Excel by using the
following line of code:
Windows(1).WindowState = xlMinimized
ReturnValue = Shell(ImgViewer, 3)

Where ImgViewer is a string containg the path and filename of the program
to
be executed.
Excel minimises but immediately returns to full screen
I have inserted a msgbox to trap the ReturnValue and it displays whilst
Excel is minimised but the image viewing program does not appear to be
running
On closing the msgbox Excel returns to normal

What have I done wrong ?

Ultimately I will want to append a variable to the ImageViewer string to
pass command line switches to the program e.g.
ReturnValue = Shell(ImgViewer &" " & Filename, 3)
Is this possible ?





  #4   Report Post  
Old September 17th 06, 03:23 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2006
Posts: 78
Default Shell to another program from Excel

You are very welcome Jim, thank you for your feedback

Regards
Anthony

"Jimbo" wrote:

Thanks for the input Anthony,
I'm not sure that I can use your method because the workbook will be used on
a number of different pcs with different image viewing programs.
With the assistance of others in this newsgroup I have managed to write the
code to identify the default image viewing program i.e. the file associated
with opening an image file. This is stored in the variable ImgViewer.
If I understand your approach correctly individual batch files would be
required and would need updating if/when different image viewing programs
were installed.
Nevertheless I thank you for your suggestion.

Regards
Jim Burton

"Anthony D" wrote in message
...
Hi Jimbo,

Have done something along similar lines which may be adaptable (?)

RetValBmp = Shell(Directory & "img.bat", vbNormalFocus)

The directory is the path to the batch file (e.g. d:\myapp\) (where the
xls
file and the image viewer i_view32.exe are also kept).
The batch file contains:
d:
cd d:\myapp\
i_view32.exe .\*.jpg /convert=.\*.bmp

It converts jpg image(s) in that directory to bmp.

Hope this (and/or further posts) may be of help

Anthony

"Jimbo" wrote:

I am trying to shell to an Image viewing program from Excel by using the
following line of code:
Windows(1).WindowState = xlMinimized
ReturnValue = Shell(ImgViewer, 3)

Where ImgViewer is a string containg the path and filename of the program
to
be executed.
Excel minimises but immediately returns to full screen
I have inserted a msgbox to trap the ReturnValue and it displays whilst
Excel is minimised but the image viewing program does not appear to be
running
On closing the msgbox Excel returns to normal

What have I done wrong ?

Ultimately I will want to append a variable to the ImageViewer string to
pass command line switches to the program e.g.
ReturnValue = Shell(ImgViewer &" " & Filename, 3)
Is this possible ?








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
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
shell out of excel into another app toothfish__[_2_] Excel Programming 0 January 19th 04 03:02 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM
How disabling sounds when calling a shell program? Michel[_3_] Excel Programming 4 October 22nd 03 09:38 AM
Shell Command to initiate Linux program verizon Excel Programming 0 October 21st 03 06:33 AM


All times are GMT +1. The time now is 09:52 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017