Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When a function in a DLL (maybe created with C or Fortran) is called
from VBA, execution of the VBA code continues without waiting for the called function to return. Is there a way to make VBA wait? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Gib Bogle;165101 Wrote: When a function in a DLL (maybe created with C or Fortran) is called from VBA, execution of the VBA code continues without waiting for the called function to return. Is there a way to make VBA wait? Hello Gib, Your statement "function to return" is ambiguous. To mean return a value back to VBA, return to VBA when the function has finished running, or both? Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=45830 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Search this group for "Shell and Wait". There are various approaches, which
will depend on what you are doing overall. Regards, Peter T "Gib Bogle" wrote in message ... When a function in a DLL (maybe created with C or Fortran) is called from VBA, execution of the VBA code continues without waiting for the called function to return. Is there a way to make VBA wait? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter T wrote:
Search this group for "Shell and Wait". There are various approaches, which will depend on what you are doing overall. Regards, Peter T I did that, and found only your post. I would have thought that "Shell" applied to executing an external process rather than to a call to a DLL routine. Am I wrong? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Gib Bogle" wrote in message
Peter T wrote: Search this group for "Shell and Wait". There are various approaches, which will depend on what you are doing overall. I did that, and found only your post. So it does, sorry about that, try "ShellAndWait" I would have thought that "Shell" applied to executing an external process rather than to a call to a DLL routine. Am I wrong? Yes you are right and perhaps I misunderstood your situation. Reading your OP again I don't understand why there is such a problem calling your dll. Normally when VBA (or an Excel formula) calls a function, even an external function in a dll, code waits until the function returns its result. Regards, Peter T |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
PS
Are you sure there is nothing in the the dll function that leads to asynchronous behaviour Regards, Peter T |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter T wrote:
PS Are you sure there is nothing in the the dll function that leads to asynchronous behaviour Regards, Peter T To be honest this is not my problem. A poster asked this question on a Fortran forum, and my curiosity was provoked. The poster says that "...Excel 2007 VBA skips over calls [to his Fortran DLL] that take any time to execute. If I go into debug mode for the VBA and pause after the call the code completes and the results are passed into Excel." This doesn't eliminate the possibility that there is something wrong with the way he handles the returned results when not in debug mode. Gib |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
60 Second Countdown NOT using the WAIT function... | Excel Programming | |||
wait function | Excel Programming | |||
Make onTimer wait until Excel finish database request? | Excel Programming | |||
How do I make the true return a drop down list in the IF function? | Excel Worksheet Functions | |||
Web Query Sleep or Wait for return values | Excel Programming |