Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default multithreading / distributing excel code

I'm fairly sure I know the answer to this (ie no)... but.. I've
inherited a vba coded market risk model which takes a looong (hours) to
run which I'd like to speed up.

Is it possible to multithread vba?

Is it possible to distribute over more than one machine?

I suspect that these are both impossible in vba, but is there any
support available which won't need a rewrite in some other language?

Cheers

Chris

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default multithreading / distributing excel code

The answer to both is no AFAIK, but why don't you post the portions of code
that are the worst offenders with some narrative and see if anyone can help
speed it up.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ps.com...
I'm fairly sure I know the answer to this (ie no)... but.. I've
inherited a vba coded market risk model which takes a looong (hours) to
run which I'd like to speed up.

Is it possible to multithread vba?

Is it possible to distribute over more than one machine?

I suspect that these are both impossible in vba, but is there any
support available which won't need a rewrite in some other language?

Cheers

Chris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default multithreading / distributing excel code

I don't think you can multithread, but there are some things that can be done
to speed up VBA.
1. Turn off ScreenUpdating (Application.ScreenUpdating = False)
2. Set Calculation to Manual if possible
(Application.Calculation = xlCalculationManual)
3. Avoid selecting cells and worksheets whenever possible (almost always)

if you would like post the code or email it to and
I'll check if there is anything obvious causing it to be so slow.
--
Charles Chickering

"A good example is twice the value of good advice."


" wrote:

I'm fairly sure I know the answer to this (ie no)... but.. I've
inherited a vba coded market risk model which takes a looong (hours) to
run which I'd like to speed up.

Is it possible to multithread vba?

Is it possible to distribute over more than one machine?

I suspect that these are both impossible in vba, but is there any
support available which won't need a rewrite in some other language?

Cheers

Chris


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default multithreading / distributing excel code

In straight VBA you're out luck, unless you can improve the efficiency of
your code.
If you have access to VB5/6, an ActiveX exe can be used like this.
Not sure if spawning multiple instances of Excel to process parts would
help; you would need to coordinate the results from each.

As Bob suggested, post simplfied code of a bottleneck and see if anyone can
offer an improvement.

NickHK


roups.com...
I'm fairly sure I know the answer to this (ie no)... but.. I've
inherited a vba coded market risk model which takes a looong (hours) to
run which I'd like to speed up.

Is it possible to multithread vba?

Is it possible to distribute over more than one machine?

I suspect that these are both impossible in vba, but is there any
support available which won't need a rewrite in some other language?

Cheers

Chris



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default multithreading / distributing excel code

Cool - thought this might be the case... was just an idea I was
mulling over

thanks for you help - I'll doubtless be back with more specific
examples

Chris

NickHK wrote:
In straight VBA you're out luck, unless you can improve the efficiency of
your code.
If you have access to VB5/6, an ActiveX exe can be used like this.
Not sure if spawning multiple instances of Excel to process parts would
help; you would need to coordinate the results from each.

As Bob suggested, post simplfied code of a bottleneck and see if anyone can
offer an improvement.

NickHK


roups.com...
I'm fairly sure I know the answer to this (ie no)... but.. I've
inherited a vba coded market risk model which takes a looong (hours) to
run which I'd like to speed up.

Is it possible to multithread vba?

Is it possible to distribute over more than one machine?

I suspect that these are both impossible in vba, but is there any
support available which won't need a rewrite in some other language?

Cheers

Chris


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best method of distributing code Andrew Excel Discussion (Misc queries) 1 June 29th 07 01:01 PM
Multithreading in Excel Paul Excel Discussion (Misc queries) 3 September 1st 05 06:47 PM
Bug in Excel? Excel Multithreading ERROR JCChin Excel Programming 1 March 1st 05 04:45 PM
distributing xl with vba code - how to know what's needed Tim[_39_] Excel Programming 0 September 22nd 04 04:52 PM
Distributing code Andy Reed Excel Programming 1 July 11th 03 12:50 AM


All times are GMT +1. The time now is 04:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"