Threads ... possible in VBA

S

SkylineGTR

Hi all,

I would like to be able to have a separate thread running while I
execute an API call - specifically, "URLDownloadFile". I want to be
able to implement a callback function such that as a file is being
downloaded I can give users feedback on progress. The API is
synchronous, therefore VBA blocks until the operation is complete ...
this is not what I want.

Has anyone come across similar problems, and if so how how did you
overcome it?

This group has not let me down so far ... I need your brains!!

Cheers
 
L

Leith Ross

Hello SkylineGTR,

Here is a link to discussion I think will help you out. It discusses
using an API timer to switch between the download operation and the VB
code. The VBA AddressOf operator makes using API callbacks easy. This
may not be the ideal solution, but sometimes close enough will do.
Here's the link http://www.vb-forum.com/showthread.php?t=226495

Sincerely,
Leith Ross
 
S

SkylineGTR

Hi Ross,

Many thanks for your reply. I tried using WinAPI timers, and all
seemed well until I called I "URLDownloadFile" API. The timer stopped
until URLDownloadFile had finished, then carried on again ... hmm ...
any ideas?
 
L

Leith Ross

Hello SkylineGTR,

I would need to see your code. With API calls and callbacks it can be
dangerous to hazard a guess. Post if you can, if not my email is
(e-mail address removed).

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top