Excel VB for Applications on Network
Morning:
This is my first chat posting ever, anywhere. I've written numerous Excel VB modules, some pretty complex but nothing like the following.
I am trying to determine how to use Excel and Visual Basic for Applications across a network of two or more PC's. I'm setting up a quasi parallel processing environment to spread the workloads across whatever number of low cost PC's I can.
The application involves taking a stream of data input into one PC where a VB program would parse the data and route certain fields to respective PCs and drop the data into any number of open Excel spreadsheets on each PC (at some point I intend to migrate to arrays, but for now I want to be able to see the results in spreadsheet layouts however slow that may be). Each sheet would run a VB program periodically (triggered somehow by a clock? logic - how?). There may be other input sources that might come into another PC and require similar routing logic as well and other separately running VB modules (some concurrently if possible).
1. Would a simple ethernet setup work? How? - bear with me, I've never set up my own network either. Other suggestions welcome.
2. How can VB programs running separately on the various machines interact? Can they?
3. Can a kind of PAUSE logic tied to a common clock allow one VB program to route to another while it's running?
4. Can a PC be set up to run multiple independent VB programs at once? Could one master PC regulate VB modules running across the network and could they all be actually running at the same time, just allowing each other to interact when conditions warrant?
5. Last issue is how can one do this on a multi-processor PC as well or instead?
References already explaining how to do this, comments, suggestions, critiques all welcome. Thanks in advance.
Gary
Re: Excel VB for Applications on Network
I would use a database as a staging point. Have your "server" insert the data stream into the database as it gets it with a field indicating which client should process it. Each client can then select data based on that field and put it in spreadsheets, calculate aggregates, etc.
More inline...
Quote:
1. Would a simple ethernet setup work? How? - bear with me, I've never set up my own network either. Other suggestions welcome.
Yes. Your main machine is essentially a server for the others (especially if it has a db on it)
Quote:
2. How can VB programs running separately on the various machines interact? Can they?
They probably won't need to, except via the database. If you need some sort of synchronization, messaging, etc. then look at the Winsock library. Each "client" can periodically check with the "server" to see what to do next.
Quote:
3. Can a kind of PAUSE logic tied to a common clock allow one VB program to route to another while it's running?
Again, probably not necessary. See #2.
Quote:
4. Can a PC be set up to run multiple independent VB programs at once?
Yes.
Quote:
Could one master PC regulate VB modules running across the network and could they all be actually running at the same time, just allowing each other to interact when conditions warrant?
See #1 and #2
Quote:
5. Last issue is how can one do this on a multi-processor PC as well or instead?
In order to take advantage of multiple processors, you need to run multiple processes. If you're opening copies of Excel, then you're already starting many processes and a multi-processor machine (with NT/2K) will take advantage of all the available resources.
IMHO, buying a big enough machine to do whatever processing you're trying to do will be much cheaper than developing and deploying this distributed app. Just my $0.02...
John