Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 515
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default 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
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
Slow Excel Navigation with Up / Down Arrow and slow scrolling deddog Excel Discussion (Misc queries) 0 August 14th 07 09:56 PM
How to get individual range objects from a set of range objects? Dev Excel Programming 4 February 4th 07 12:14 AM
Excel VBA Class Objects - Parent & Successor Objects [email protected] Excel Programming 1 January 15th 07 12:06 AM
Dynamically Assign Objects to Form Objects. The Vision Thing Excel Programming 2 December 11th 04 04:02 PM
Unable to remove Sheet objects in the Microsoft Excel Objects Adrian[_7_] Excel Programming 1 August 26th 04 10:49 PM


All times are GMT +1. The time now is 02:37 PM.

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"