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 to open .exe file


Hello,

How do I open a .exe file that resides on the c drive.

C:\windows\convert.exe

This is a file of a conversion chart

Thanks EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=498262

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default VBA to open .exe file

i had the same question as you. i found this in another post

Dim sAcrobat As String
sAcrobat = "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"
Shell sAcrobat
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default VBA to open .exe file

i had the same question as you. i found this in another post

Dim sAcrobat As String
sAcrobat = "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"
Shell sAcrobat
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA to open .exe file


Thanks for the tip Don & for your input Paul!

Don it searched the helps section, and found it to be helpful.

This is what I came up with.

Sub OpenConvertMe()
Dim RetVal
RetVal = Shell("C:\WINDOWS\Convert.EXE", 1)
End Sub

This worked fine. Question though, what does the *,1* mean in thi
code?

Thanks,
EMoe :

--
EMo
-----------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...fo&userid=2318
View this thread: http://www.excelforum.com/showthread.php?threadid=49826



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VBA to open .exe file

The '1' in the Shell function indicates that the window should
have normal focus. In VBA, press F2 to open the object browser,
and search for VbAppWinStyle and you'll see all the possible
symbolic constants that can be used in the Shell function. and
the numeric value of those constants.

It is poor programming practice to use the numeric value of a
constant in place of the name.


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





"EMoe" wrote
in message
...

Thanks for the tip Don & for your input Paul!

Don it searched the helps section, and found it to be helpful.

This is what I came up with.

Sub OpenConvertMe()
Dim RetVal
RetVal = Shell("C:\WINDOWS\Convert.EXE", 1)
End Sub

This worked fine. Question though, what does the *,1* mean in
this
code?

Thanks,
EMoe :)


--
EMoe
------------------------------------------------------------------------
EMoe's Profile:
http://www.excelforum.com/member.php...o&userid=23183
View this thread:
http://www.excelforum.com/showthread...hreadid=498262



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default VBA to open .exe file


Hi Chip,

It is poor programming practice to use the numeric value of a
constant in place of the name.


Apart from readability, are there other reasons ?

Regards,
Peter T


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
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 2 July 8th 05 05:51 AM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 0 July 2nd 05 08:41 PM


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