![]() |
Running other programs with VBA
I am using a wedge program to link a rs-232 device with excel. To help
streamline things for other users I would like to start the program from within the excel worksheet that does the scoring. I have done a search and found that I can start a program using Shell "C:\path\wedge.exe", vbNormalFocus What I want to know is can I use command to open a settings file within the wedge program. It has shortcut keys ALT F then O to open file. Is it possible to right code to run these keystrokes and type in the filename and path in the open file window. If not the settings file will always be number 1 on the list of recently opened files and can be run by ALT F then 1. Once the file is opened the wedge program is set to run mininimised automatically and it automatically brings the focus back to excel so that part should be okay but is there a way to force the focus back to excel just to be sure. |
Running other programs with VBA
Does the wedge program have a command line parameter to specify a settings
file? Tim "NDBC" wrote in message ... I am using a wedge program to link a rs-232 device with excel. To help streamline things for other users I would like to start the program from within the excel worksheet that does the scoring. I have done a search and found that I can start a program using Shell "C:\path\wedge.exe", vbNormalFocus What I want to know is can I use command to open a settings file within the wedge program. It has shortcut keys ALT F then O to open file. Is it possible to right code to run these keystrokes and type in the filename and path in the open file window. If not the settings file will always be number 1 on the list of recently opened files and can be run by ALT F then 1. Once the file is opened the wedge program is set to run mininimised automatically and it automatically brings the focus back to excel so that part should be okay but is there a way to force the focus back to excel just to be sure. |
Running other programs with VBA
Not that I can find. I did notice however if in explorer and I double click
on the configuration file it will open the program with that configuration loaded. So I tried shell("c:\program files\wedgelink\ndbc.wlc", 6) where ndbc.wlc is the configuration file to try and fire it up but this doesn't work. I also tried shell("c:\program files\wedgelink\wedglink.exe c:\program files\wedgelink\ndbc.wlc", 6) to no avail. The exe and the configuration file are in the same directory. "Tim Williams" wrote: Does the wedge program have a command line parameter to specify a settings file? Tim "NDBC" wrote in message ... I am using a wedge program to link a rs-232 device with excel. To help streamline things for other users I would like to start the program from within the excel worksheet that does the scoring. I have done a search and found that I can start a program using Shell "C:\path\wedge.exe", vbNormalFocus What I want to know is can I use command to open a settings file within the wedge program. It has shortcut keys ALT F then O to open file. Is it possible to right code to run these keystrokes and type in the filename and path in the open file window. If not the settings file will always be number 1 on the list of recently opened files and can be run by ALT F then 1. Once the file is opened the wedge program is set to run mininimised automatically and it automatically brings the focus back to excel so that part should be okay but is there a way to force the focus back to excel just to be sure. |
Running other programs with VBA
Maybe try this ?
http://www.vbforums.com/showthread.php?t=166743 Tim "NDBC" wrote in message ... Not that I can find. I did notice however if in explorer and I double click on the configuration file it will open the program with that configuration loaded. So I tried shell("c:\program files\wedgelink\ndbc.wlc", 6) where ndbc.wlc is the configuration file to try and fire it up but this doesn't work. I also tried shell("c:\program files\wedgelink\wedglink.exe c:\program files\wedgelink\ndbc.wlc", 6) to no avail. The exe and the configuration file are in the same directory. "Tim Williams" wrote: Does the wedge program have a command line parameter to specify a settings file? Tim "NDBC" wrote in message ... I am using a wedge program to link a rs-232 device with excel. To help streamline things for other users I would like to start the program from within the excel worksheet that does the scoring. I have done a search and found that I can start a program using Shell "C:\path\wedge.exe", vbNormalFocus What I want to know is can I use command to open a settings file within the wedge program. It has shortcut keys ALT F then O to open file. Is it possible to right code to run these keystrokes and type in the filename and path in the open file window. If not the settings file will always be number 1 on the list of recently opened files and can be run by ALT F then 1. Once the file is opened the wedge program is set to run mininimised automatically and it automatically brings the focus back to excel so that part should be okay but is there a way to force the focus back to excel just to be sure. |
Running other programs with VBA
Thanks for finding that. I haven't tried it yet as I don't even pretend to
understand what it means. I especially don't understand the variable me.hwnd and why the form needs to be loaded. Can anyone explain this to me. Thanks "Tim Williams" wrote: Maybe try this ? http://www.vbforums.com/showthread.php?t=166743 Tim "NDBC" wrote in message ... Not that I can find. I did notice however if in explorer and I double click on the configuration file it will open the program with that configuration loaded. So I tried shell("c:\program files\wedgelink\ndbc.wlc", 6) where ndbc.wlc is the configuration file to try and fire it up but this doesn't work. I also tried shell("c:\program files\wedgelink\wedglink.exe c:\program files\wedgelink\ndbc.wlc", 6) to no avail. The exe and the configuration file are in the same directory. "Tim Williams" wrote: Does the wedge program have a command line parameter to specify a settings file? Tim "NDBC" wrote in message ... I am using a wedge program to link a rs-232 device with excel. To help streamline things for other users I would like to start the program from within the excel worksheet that does the scoring. I have done a search and found that I can start a program using Shell "C:\path\wedge.exe", vbNormalFocus What I want to know is can I use command to open a settings file within the wedge program. It has shortcut keys ALT F then O to open file. Is it possible to right code to run these keystrokes and type in the filename and path in the open file window. If not the settings file will always be number 1 on the list of recently opened files and can be run by ALT F then 1. Once the file is opened the wedge program is set to run mininimised automatically and it automatically brings the focus back to excel so that part should be okay but is there a way to force the focus back to excel just to be sure. |
Running other programs with VBA
You might try reviewing some registry settings to determine the correct
command line to launch a specific file opening. At the Start | Run line, type "regedit" without the quotes and press Enter. Navigate to HKEY_CLASSES_ROOT\.wlc Take a look at the default value in the right pane (value named Default, locate what the name is in the data column. It's probably something like wedgeFile). Suppose for the example that the default was "wedgeFile". Then, navigate to HKEY_CLASSES_ROOT\wedgeFile\shell\open\command Take a look at the command line in the right pane and make note of it. If you find a "%1", that's a placeholder that represents the path and file name of the file you want launched. Pay attention to note any switches that might be needed. Steve Yandl "NDBC" wrote in message ... Not that I can find. I did notice however if in explorer and I double click on the configuration file it will open the program with that configuration loaded. So I tried shell("c:\program files\wedgelink\ndbc.wlc", 6) where ndbc.wlc is the configuration file to try and fire it up but this doesn't work. I also tried shell("c:\program files\wedgelink\wedglink.exe c:\program files\wedgelink\ndbc.wlc", 6) to no avail. The exe and the configuration file are in the same directory. "Tim Williams" wrote: Does the wedge program have a command line parameter to specify a settings file? Tim "NDBC" wrote in message ... I am using a wedge program to link a rs-232 device with excel. To help streamline things for other users I would like to start the program from within the excel worksheet that does the scoring. I have done a search and found that I can start a program using Shell "C:\path\wedge.exe", vbNormalFocus What I want to know is can I use command to open a settings file within the wedge program. It has shortcut keys ALT F then O to open file. Is it possible to right code to run these keystrokes and type in the filename and path in the open file window. If not the settings file will always be number 1 on the list of recently opened files and can be run by ALT F then 1. Once the file is opened the wedge program is set to run mininimised automatically and it automatically brings the focus back to excel so that part should be okay but is there a way to force the focus back to excel just to be sure. |
Running other programs with VBA
I hadn't really noticed the forms part, but you can find other "non-form"
examples: Eg; http://www.suodenjoki.dk/us/producti...ellexecute.htm Tim "NDBC" wrote in message ... Thanks for finding that. I haven't tried it yet as I don't even pretend to understand what it means. I especially don't understand the variable me.hwnd and why the form needs to be loaded. Can anyone explain this to me. Thanks "Tim Williams" wrote: Maybe try this ? http://www.vbforums.com/showthread.php?t=166743 Tim "NDBC" wrote in message ... Not that I can find. I did notice however if in explorer and I double click on the configuration file it will open the program with that configuration loaded. So I tried shell("c:\program files\wedgelink\ndbc.wlc", 6) where ndbc.wlc is the configuration file to try and fire it up but this doesn't work. I also tried shell("c:\program files\wedgelink\wedglink.exe c:\program files\wedgelink\ndbc.wlc", 6) to no avail. The exe and the configuration file are in the same directory. "Tim Williams" wrote: Does the wedge program have a command line parameter to specify a settings file? Tim "NDBC" wrote in message ... I am using a wedge program to link a rs-232 device with excel. To help streamline things for other users I would like to start the program from within the excel worksheet that does the scoring. I have done a search and found that I can start a program using Shell "C:\path\wedge.exe", vbNormalFocus What I want to know is can I use command to open a settings file within the wedge program. It has shortcut keys ALT F then O to open file. Is it possible to right code to run these keystrokes and type in the filename and path in the open file window. If not the settings file will always be number 1 on the list of recently opened files and can be run by ALT F then 1. Once the file is opened the wedge program is set to run mininimised automatically and it automatically brings the focus back to excel so that part should be okay but is there a way to force the focus back to excel just to be sure. |
Running other programs with VBA
NDBC,
I think finding the correct command line is going to be your best bet and I offer some hints in a separate comment already posted. However, if you can't get that to work, you might want to do a bit of research on the "Tasks" collection available in MS Word VBA. Granted, it would involve opening and closing a hidden instance of Word from your Excel VBA but it might give you the tools you need. Basically, Tasks are open applications and you can use the Name property to isolate the specific one you're needing to work with. At that point, you can send a Windows message (a hex number that causes the application to do a specific thing based on that hex number). Since I don't have the wedge.exe program you're working with, it's tough to offer anything more specific. Steve Yandl "NDBC" wrote in message ... Thanks for finding that. I haven't tried it yet as I don't even pretend to understand what it means. I especially don't understand the variable me.hwnd and why the form needs to be loaded. Can anyone explain this to me. Thanks "Tim Williams" wrote: Maybe try this ? http://www.vbforums.com/showthread.php?t=166743 Tim "NDBC" wrote in message ... Not that I can find. I did notice however if in explorer and I double click on the configuration file it will open the program with that configuration loaded. So I tried shell("c:\program files\wedgelink\ndbc.wlc", 6) where ndbc.wlc is the configuration file to try and fire it up but this doesn't work. I also tried shell("c:\program files\wedgelink\wedglink.exe c:\program files\wedgelink\ndbc.wlc", 6) to no avail. The exe and the configuration file are in the same directory. "Tim Williams" wrote: Does the wedge program have a command line parameter to specify a settings file? Tim "NDBC" wrote in message ... I am using a wedge program to link a rs-232 device with excel. To help streamline things for other users I would like to start the program from within the excel worksheet that does the scoring. I have done a search and found that I can start a program using Shell "C:\path\wedge.exe", vbNormalFocus What I want to know is can I use command to open a settings file within the wedge program. It has shortcut keys ALT F then O to open file. Is it possible to right code to run these keystrokes and type in the filename and path in the open file window. If not the settings file will always be number 1 on the list of recently opened files and can be run by ALT F then 1. Once the file is opened the wedge program is set to run mininimised automatically and it automatically brings the focus back to excel so that part should be okay but is there a way to force the focus back to excel just to be sure. |
All times are GMT +1. The time now is 02:15 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com