Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are objects slow in VBA?
Hello
I just have a general question: in your opinion, are objects in VBA slower than using directly arrays and subs? I mean you necessarily have a few more declarations to do, etc in the object. But that aside, does the management of objects by VBA significantly reduces the speed of execution of the code? I have made a try, and I am a bit disappointed by the exec time. Could be my fault, but just asking in case... thanks! Charles |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are objects slow in VBA?
In my experience object ore not distinctly slower than regular procedural
programming. As you say they do come with a bit more overhead but not enough to cause great concern... -- HTH... Jim Thomlinson "Charles" wrote: Hello I just have a general question: in your opinion, are objects in VBA slower than using directly arrays and subs? I mean you necessarily have a few more declarations to do, etc in the object. But that aside, does the management of objects by VBA significantly reduces the speed of execution of the code? I have made a try, and I am a bit disappointed by the exec time. Could be my fault, but just asking in case... thanks! Charles |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are objects slow in VBA?
Maybe if you post your code, someone will be able to assist? VBA is not slow
though -- Hth Kassie Kasselman Change xxx to hotmail "Charles" wrote: Hello I just have a general question: in your opinion, are objects in VBA slower than using directly arrays and subs? I mean you necessarily have a few more declarations to do, etc in the object. But that aside, does the management of objects by VBA significantly reduces the speed of execution of the code? I have made a try, and I am a bit disappointed by the exec time. Could be my fault, but just asking in case... thanks! Charles |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are objects slow in VBA?
It depends what you mean by object. If you mean manipulating a range one
cell at a time, yes, this might be obviously slower than manipulating the entire range at once, or than getting the values into VBA, doing calculations, and dumping the results back into the sheet. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Charles" wrote in message oups.com... Hello I just have a general question: in your opinion, are objects in VBA slower than using directly arrays and subs? I mean you necessarily have a few more declarations to do, etc in the object. But that aside, does the management of objects by VBA significantly reduces the speed of execution of the code? I have made a try, and I am a bit disappointed by the exec time. Could be my fault, but just asking in case... thanks! Charles |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are objects slow in VBA?
Sorry, I didn't mean Excel object. I understood the Excel-VBA link is
extremely slow. I was thinking to VBA-defined objects (using "class"). I left everything on option explicit, "long" used for integers. I think that I must simply do an unecessary number of loops. Also, I am building a model aimed to do monte carlo simulations. So I was looking at how long it took to run 10,000 times the model (which implies about 50 arrays of dim ~40*1, and some loops to populate/ aggregate them). I guess that with that sort of dimensions, I can't expect it to take less than a minute. Charles |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Are objects slow in VBA?
I've always felt that working within VBA was *not* the rate limiting part of
most of my applications, even the intensive data manipulation ones. But 10k simulations requiring that many arrays of that size should be expected to take more than a couple seconds. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Charles" wrote in message ps.com... Sorry, I didn't mean Excel object. I understood the Excel-VBA link is extremely slow. I was thinking to VBA-defined objects (using "class"). I left everything on option explicit, "long" used for integers. I think that I must simply do an unecessary number of loops. Also, I am building a model aimed to do monte carlo simulations. So I was looking at how long it took to run 10,000 times the model (which implies about 50 arrays of dim ~40*1, and some loops to populate/ aggregate them). I guess that with that sort of dimensions, I can't expect it to take less than a minute. Charles |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Slow Excel Navigation with Up / Down Arrow and slow scrolling | Excel Discussion (Misc queries) | |||
How to get individual range objects from a set of range objects? | Excel Programming | |||
Excel VBA Class Objects - Parent & Successor Objects | Excel Programming | |||
Dynamically Assign Objects to Form Objects. | Excel Programming | |||
Unable to remove Sheet objects in the Microsoft Excel Objects | Excel Programming |