Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to activate a Batch file !
i've just installed a cash drawer for my grocery store and the thing
opens with the PC using a serial cnxn and the execution of a batch file , can anyone help me in have the batch file executed from Excel using a macro !!! ASAP please thnx |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to activate a Batch file !
sub RunBat()
shell "C:\myfolder\mybat.bat" End Sub -- Regards, Tom Ogilvy Tarek wrote in message m... i've just installed a cash drawer for my grocery store and the thing opens with the PC using a serial cnxn and the execution of a batch file , can anyone help me in have the batch file executed from Excel using a macro !!! ASAP please thnx |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to activate a Batch file !
Dear Tom,
Thnx a lot, the code worked just fine , but as soon as i saved the excel sheet and exited and reopened, it stopped working and then i noticed that the batch file switched location to "c:\ my documents\read.bat" instead of c:\windows\desktop\read.bat" why is this happening. I've also tried hyperlinking to the batch file, but the same thing happened (I've seen the properties of the batch file and the "Commandline" and "Working" slots are empty, could that be the cause ?? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to activate a Batch file !
I can't say, but I would save the file in a specific directory (hopefully
the bat file doesn't contain code that moves it to another location). Then the directory should not change I wouldn't think. You can look at the bat file in notepad and see what code it contains. -- Regards, Tom Ogilvy "Tarek Naghaway" wrote in message ... Dear Tom, Thnx a lot, the code worked just fine , but as soon as i saved the excel sheet and exited and reopened, it stopped working and then i noticed that the batch file switched location to "c:\ my documents\read.bat" instead of c:\windows\desktop\read.bat" why is this happening. I've also tried hyperlinking to the batch file, but the same thing happened (I've seen the properties of the batch file and the "Commandline" and "Working" slots are empty, could that be the cause ?? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Batch file initiation from Excel macro? | Excel Discussion (Misc queries) | |||
Call a batch file from an Excel Macro | Excel Discussion (Misc queries) | |||
Call a batch file from an Excel Macro | Excel Discussion (Misc queries) | |||
How to auto activate macro when file opened | Excel Worksheet Functions | |||
How to auto activate macro when file open ? | Excel Worksheet Functions |