Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Batch file initiation from Excel macro? Yarroll Excel Discussion (Misc queries) 1 October 13th 06 02:50 PM
Call a batch file from an Excel Macro Alex Horan Excel Discussion (Misc queries) 0 March 2nd 06 03:29 PM
Call a batch file from an Excel Macro Gary''s Student Excel Discussion (Misc queries) 0 March 2nd 06 03:26 PM
How to auto activate macro when file opened bonzio Excel Worksheet Functions 3 December 17th 05 03:19 PM
How to auto activate macro when file open ? bonzio Excel Worksheet Functions 1 December 16th 05 02:45 PM


All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"