ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run a Batch file with variables (https://www.excelbanter.com/excel-discussion-misc-queries/90277-run-batch-file-variables.html)

Stuartf

Run a Batch file with variables
 

Hi

I want to be able to open an application from with-in excel which will
then open a job withing the app.

Example

Batch file (Run.bat) : "C:\Program Files\IequalsP\pressing matters
cygnus\cygnus.exe" %1

%1 = D12345 ( a job number )

so in excel something like

=HYPERLINK("Run.bat D12345","Open Job")


--
Stuartf
------------------------------------------------------------------------
Stuartf's Profile: http://www.excelforum.com/member.php...o&userid=34535
View this thread: http://www.excelforum.com/showthread...hreadid=545091


CLR

Run a Batch file with variables
 
This old code, run from a regular module in Excel, will open AutoCAD and
then the file called acadtest.dwg........perhaps it will help point the way
to what you want to do....

Sub StartAutocad()
VBA.Shell "c:\program files\autocad lt 2000i\aclt.exe c:\acadtest1.dwg",
vbMaximizedFocus
Dim oAutoCad As Object
Set oAutoCad = GetObject("c:\acadtest1.dwg")
oAutoCad.sendcommand "filedia" & Chr(32) & "0" & Chr(32)
oAutoCad.sendcommand "script" & vbCr & "c:\Program
Files\Scriptsheets\Script.scr" & vbCr & vbCr
oAutoCad.sendcommand "filedia" & Chr(32) & "1" & Chr(32)
End Sub


Vaya con Dios,
Chuck, CABGx3





"Stuartf" wrote:


Hi

I want to be able to open an application from with-in excel which will
then open a job withing the app.

Example

Batch file (Run.bat) : "C:\Program Files\IequalsP\pressing matters
cygnus\cygnus.exe" %1

%1 = D12345 ( a job number )

so in excel something like

=HYPERLINK("Run.bat D12345","Open Job")


--
Stuartf
------------------------------------------------------------------------
Stuartf's Profile: http://www.excelforum.com/member.php...o&userid=34535
View this thread: http://www.excelforum.com/showthread...hreadid=545091




All times are GMT +1. The time now is 10:27 PM.

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