![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Microsoft Office support MS Office support forum |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Apr 2009
Posts: 1
OS: winXP 3
|
Excel VBA Shell and Wait
I need help with some code regarding shell and wait. I am trying to write a shell that triggers a .exe file and regrinds hours in the POS system that my restaurants use. I need to have the startdate equal the cell in Sheet 1 Cell A1 and then go back to Monday and stop before Sunday. A few things I am having trouble with:
-How do I set the startdate to equal that cell and format the start date to "yyyyddmm" and run the .exe file to loop from startdate to Monday and stop before Sunday. -If the file does not exist, how do I handle the error so the loop continues. -Also, I need it to also incorporate a shell and wait that will not continue to the next step of code until the shell has finished but to stop running after 3 minutes if the shell does not complete the task. I have read about the shell and wait function but I don't really understand it that much. Here is what I have so far even though it's not much: Sub GndHours() On Error GoTo GndErr Dim RetVal RetVal = Shell("C:\aloha\bin\grind.exe /date yyyyddmm") ExitHere: Exit Sub GndErr: Select Case Err.Number Case Else Resume ExitHere End Select End Sub Your help will be much appreciated. |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
![]() |
| Thread Tools | |
|
|