ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Accessing other programs through VBA (https://www.excelbanter.com/excel-programming/342007-accessing-other-programs-through-vba.html)

J Streger

Accessing other programs through VBA
 
I am trying to create a sub-routine that will allow me to access and send
commands to a non-Microsoft product (in this case a scanner program). Can
anyone suggest a means of doing this. I've tried Shell and Send Keys but it's
not working.

Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003


Jim Thomlinson[_4_]

Accessing other programs through VBA
 
Does the other program have any API's that you can use to manipulate the
functions of the external program? If not then (to the best of my knowledge)
you are hooped.
--
HTH...

Jim Thomlinson


"J Streger" wrote:

I am trying to create a sub-routine that will allow me to access and send
commands to a non-Microsoft product (in this case a scanner program). Can
anyone suggest a means of doing this. I've tried Shell and Send Keys but it's
not working.

Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003


Jef Gorbach

Accessing other programs through VBA
 

"J Streger" wrote in message
...
I am trying to create a sub-routine that will allow me to access and send
commands to a non-Microsoft product (in this case a scanner program). Can
anyone suggest a means of doing this. I've tried Shell and Send Keys but

it's
not working.

Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003



Not exactly what you requested, but might help point in the right direction
using Windows Script Host to overcome HP Precisionscan software's lack of
ability to change the default settings to match the lower resolution needed
for a particular routine project.
WSH supposedly can startup the scanning software as well but i never found
the typo in those lines so removed them and went with a simple batch file
instead.

scan.bat
goto start
runs HP Precision Scan then changeresolution.vbs to change Image Resolution
to 75-dpi since cant permanetly change within program then preveiw the first
page
:start
"C:\Program Files\Hewlett-Packard\HP PrecisionScan\PrecisionScan
LTX\hppsapp.exe"
cscript c:\bat\changescanresolution.vbs
exit

changescanresolution.vbs
'wait 5 seconds for Scanner to load via a popup then change default image
resolution to 75-dpi
'then change output to File and preview the first item
'----------------------------------------------
Dim Wsh
Set Wsh = Wscript.CreateObject("Wscript.Shell")
wsh.Popup "Wait for Scanner to load", 30, "Wait...",64
Wsh.AppActivate "HP PrecisionScan LTX"
Wsh.SendKeys "%grc{tab}{tab}{tab}{tab}200~{tab}~"
Wsh.Sendkeys "%wf"
Wsh.Sendkeys "%n"





All times are GMT +1. The time now is 03:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com