Vba status bar not updating
Until now I was simply doing that by writing the messages to a file and then sometimes checking that file, but I found that printing the messages directly to my Access User form was more friendly.Since I call the callback function from my DLL only once in a while (say, every 10 s), it's ok to use Do Event, which is not encapsulated into a wasting-resources loop. That being said I know Fortran better than VBA, and if you have suggestions of simpler way to achieve what I want to do, please tell me ! : is there simple a way to unload the DLL after it has been called, other than reinitializing the VBA project? My brother's a geophysicist, and he's recently got into Access too, to handle some of the enormous datasets he has to deal with (although he mainly still works in Excel - his comfort zone ;)).In the example below, the code releases control to the Windows Environment for every 100,000 iterations of the Loop. Also you may know that we scientists still like to use good old Fortran for data processing, because it's fast and efficient (faster than vba, at least) and also because it's an old habit.As previously stated, this may not be applicable, and you may also have to tweek how many time you use the Do Events() Function. This explains I use a lot this combination of VBA (for GUI) and Fortran DLL (for data processing).Check whether your callback doesn't return to calling DLL or maybe reentered. I simply added a Do Events() at the end of the Callback function, as suggested.I did not know that function, I was rather looking for sth like Application.Refresh Anyway I guess that's it's a quick'n'dirty way to handle the problem (a Timer control may be a better choice), but that's enough in my simple case. I simply added a Do Events() at the end of the Callback function, as suggested.
That's only a detail, but I constantly have to modify and recompile the DLL, and it's a bit annoying to always reinitialize the VBA project to be able to do so.However, if you get callbacks from within the routine where you update your screen, you need to revisit ADezii's point #4 and use Do Events in your update code.