Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
exit main sub or function in VBA Excel 2003

looping the main() Sub in whole day.
but it fail because it always exit only on the sub of sub instead of my expectation
that should quit the main sub. Just want to read a signal in other xls file and then quit the main
program when the signal=0. That will let me easily to put break point anywhere in main() to interrupt the program
running during looping main () for whole day. Anyideal to fix the following code , Please advise
I have tried to use xlapp.quit or application.quit acquitsaveall but it still have issue on such command code
Br
Duncan
-------------------------
Fail code as follows:
Sub main ()
'
Call quitprogram 'if signal=0 in instruction.xls at B1, then quit/exit the main sub
'
End Sub
Sub Quitprogram()
Workbooks.Open Filename:= _
"d:instruction.xls"
If Range("b1") = 0 Then
ActiveWorkbook.Close False
Exit Sub 'xlapp.quit or application.quit acquitsaveall that also doesn't work here
Else
ActiveWorkbook.Close False
End Sub
Now my program running time is down from 30 seconds to 6 seconds with 30,000 VBA code statement, My target is running it
within 0.5 or 1 seconds. So I need to put backup plan once program running problem and stop it immedately and re-run it.
Time is value in this world, More big question is coming
Now my program running time is down from 30 seconds to 6 seconds with 30,000 VBA code statement, My target is running it
within 0.5 or 1 seconds. So I need to put backup plan once program running problem and stop it immedately and re-run it.
Time is value in this world, More big question is coming
Now my program running time is down from 30 seconds to 6 seconds with 30,000 VBA code statement, My target is running it
within 0.5 or 1 seconds. So I need to put backup plan once program running problem and stop it immedately and re-run it.
Time is value in this world, More big question is coming
Now my program running time is down from 30 seconds to 6 seconds with 30,000 VBA code statement, My target is running it
within 0.5 or 1 seconds. So I need to put backup plan once program running problem and stop it immedately and re-run it.
Time is value in this world, More big question is coming