-
Jan 29th, 2021, 07:54 AM
#1
Thread Starter
Hyperactive Member
Threads -vba background task
Is it possible to run a VBA macro as a background task and as such will not lock up the UI or prevent other tasks from being carried out ?
-
Jan 29th, 2021, 07:05 PM
#2
Re: Threads -vba background task
This is one area where a DoEvents statement in the VBA Code at an appropriate point will allow you to continue to use the computer for other tasks while the VBA macro is processing your data.
-
Jan 29th, 2021, 07:59 PM
#3
Thread Starter
Hyperactive Member
Re: Threads -vba background task
Thanks, Is there no way to define a new thread and start the task under the new thread like in vb.net
It's the same application that the macro is running under that I want to continue to using
-
Jan 29th, 2021, 09:32 PM
#4
Re: Threads -vba background task
Thanks, Is there no way to define a new thread and start the task under the new thread like in vb.net
not that i have done it, but probably can be done, not as simple as vb.net, i would search in the vb6 forum for createthread
depending what you are doing you could also use a timer (API timer), which i have done to make a clock keep running and updating the display, without locking the application
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|