PC Review


Reply
Thread Tools Rate Thread

Best solution VBA/C++

 
 
Charles
Guest
Posts: n/a
 
      1st Aug 2006
Hello

I am seeking some advice on the best solution for a small program I
have to build. I need to design a program which can be launched in
Excel, would acquire some data from Excel, then run some cash flow
calculations (so mostly working on multiple small arrays with a lot of
conditions and simple calculations) and would run some monte carlo
simulations.

So basically I need a program which would be fast enough so that I can
run my calculations 1,000s of times in a reasonable time, that would
have access to a proper random number generator (I guess I have to go
for a commercial product for that, any suggestion?), and which could
easily communicate with Excel.

For the moment I think I can run that in VBA. C++ is quite unflexible
and would probably require a little more time to code my stuff. In top
I would have to manage the interface between VBA and C++. On the other
side, I don't know how much faster the program would run under C++
compared to VBA. Can C++ really save some time on functions like if,
loops, while, and simple array calculations? (there will be no access
to excel between the begining and the end of the program).

If anyone has an opinion or a suggestion, I am happy to take it!
Best regards
Charles

 
Reply With Quote
 
 
 
 
Mike Middleton
Guest
Posts: n/a
 
      2nd Aug 2006
Charles -

If you can build the cash flow model in Excel, you could perform the Monte
Carlo simulation using industrial-strength software like Crystal Ball
(www.crystalball.com) or @RISK (www.palisade.com).

Or, you could use less expensive simulation software like my RiskSim
(www.treeplan.com) or Sam Savage's XLSIM package (www.analycorp.com).

Or, you can reinvent the wheel and write VBA or C++ code, where compiled C++
will undoubtedly be faster than interpreted VBA.

- Mike
www.mikemiddleton.com

"Charles" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
> I am seeking some advice on the best solution for a small program I
> have to build. I need to design a program which can be launched in
> Excel, would acquire some data from Excel, then run some cash flow
> calculations (so mostly working on multiple small arrays with a lot of
> conditions and simple calculations) and would run some monte carlo
> simulations.
> So basically I need a program which would be fast enough so that I can
> run my calculations 1,000s of times in a reasonable time, that would
> have access to a proper random number generator (I guess I have to go
> for a commercial product for that, any suggestion?), and which could
> easily communicate with Excel.
> For the moment I think I can run that in VBA. C++ is quite unflexible
> and would probably require a little more time to code my stuff. In top
> I would have to manage the interface between VBA and C++. On the other
> side, I don't know how much faster the program would run under C++
> compared to VBA. Can C++ really save some time on functions like if,
> loops, while, and simple array calculations? (there will be no access
> to excel between the begining and the end of the program).
> If anyone has an opinion or a suggestion, I am happy to take it!
> Best regards
> Charles



 
Reply With Quote
 
Charles
Guest
Posts: n/a
 
      2nd Aug 2006
Thanks for your answer

For the first solution, I think that Crystal Ball just uses the results
from the calculations of the spreadsheet? My problem is that we are
talking about a significantly complex cash flow model, which is to be
honest already a bit slow to process in Excel. (Not slow enough to be a
problem in Excel, but slow enough to be worried if it had to be ran
100,000 times).That's why I can hardly see a way to do it without VBA
and/or C++.

My question is rather: will I win a significant amount of runtime by
using C++ than by using properly (declaring all the variables, etc)
VBA?

You look like you know these software quite well. I think I would
mostly use their random number generation capabilities. Do you know how
they compare for that purpose?

Charles


Mike Middleton wrote:
> Charles -
>
> If you can build the cash flow model in Excel, you could perform the Monte
> Carlo simulation using industrial-strength software like Crystal Ball
> (www.crystalball.com) or @RISK (www.palisade.com).
>
> Or, you could use less expensive simulation software like my RiskSim
> (www.treeplan.com) or Sam Savage's XLSIM package (www.analycorp.com).
>
> Or, you can reinvent the wheel and write VBA or C++ code, where compiled C++
> will undoubtedly be faster than interpreted VBA.
>
> - Mike
> www.mikemiddleton.com
>


 
Reply With Quote
 
Mike Middleton
Guest
Posts: n/a
 
      2nd Aug 2006
Charles -

I do not have direct experience comparing VBA and C++. For some anecdotal
evidence regarding VBA vs. C++, see

http://groups.google.com/group/micro...62051cc639479f

or search Google Groups for "excel ian smith" (without the quotes) to find
the above message and other relevant information. Ian Smith can provide
numerous relevant VBA functions for Monte Carlo simulation, e.g.,

http://groups.google.com/group/micro...4626d90261b42f

Another important resource regarding Excel calculation speed is Charles
Williams' web site

http://www.decisionmodels.com/

- Mike

"Charles" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for your answer
>
> For the first solution, I think that Crystal Ball just uses the results
> from the calculations of the spreadsheet? My problem is that we are
> talking about a significantly complex cash flow model, which is to be
> honest already a bit slow to process in Excel. (Not slow enough to be a
> problem in Excel, but slow enough to be worried if it had to be ran
> 100,000 times).That's why I can hardly see a way to do it without VBA
> and/or C++.
>
> My question is rather: will I win a significant amount of runtime by
> using C++ than by using properly (declaring all the variables, etc)
> VBA?
>
> You look like you know these software quite well. I think I would
> mostly use their random number generation capabilities. Do you know how
> they compare for that purpose?
>
> Charles
>
>
> Mike Middleton wrote:
>> Charles -
>>
>> If you can build the cash flow model in Excel, you could perform the
>> Monte
>> Carlo simulation using industrial-strength software like Crystal Ball
>> (www.crystalball.com) or @RISK (www.palisade.com).
>>
>> Or, you could use less expensive simulation software like my RiskSim
>> (www.treeplan.com) or Sam Savage's XLSIM package (www.analycorp.com).
>>
>> Or, you can reinvent the wheel and write VBA or C++ code, where compiled
>> C++
>> will undoubtedly be faster than interpreted VBA.
>>
>> - Mike
>> www.mikemiddleton.com
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion VS2005 Solution to VS2008 Solution sippyuconn Microsoft C# .NET 4 23rd May 2008 10:03 AM
How to copy a Form from one solution to another solution? AlexAngAB@gmail.com Microsoft Dot NET Framework 2 9th Dec 2006 02:15 PM
Solution file not in the solution folder =?Utf-8?B?Y2FzaGRlc2ttYWM=?= Microsoft ASP .NET 2 12th Sep 2006 12:04 PM
Build Solution vs. ReBuild Solution Microsoft VB .NET 2 4th Feb 2005 01:19 PM
rebuild solution automaticly each time im running the solution in the ide Daylor Microsoft Dot NET 1 24th Sep 2003 05:33 PM


Features
 

Advertising
 

Newsgroups
 


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