LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Efficiency, Workbook objects in User Defined Record

An Object variable is very cheap in terms of resources. It's just a pointer
to the address in memory where the actual object exists. The main thing to
be careful of is to ensure any object variable is released once the object
no longer exists (no need to do anything if the variable is about to loose
its scope).

In passing, though it's a matter of style "Types" are generally appropriate
for a number of closely associated variables, eg name, age, address. I get
the impression you are using a Type merely as a means of consolidating a
number of variable to avoid passing them all in one go.
Since 16-bit has all but disappeared best to change those As Integer to As
Long

Regards,
Peter T


"Neal Zimm" wrote in message
...
Hi All,

Am developing an App where user's Wbk references an AddIn.

Data in AddIn sheets control options available to users.

Some of this data becomes arrays in a User record and I use the
AddIn object a lot for lookups.

Record is updated in a bunch of different Sub's and Functions.

Public Type uOptRec 'there are more fields, about 20. a few to
illustrate

iMthDaysAy(12) as integer 'Qty of days in month

iMidMthDay(12) as integer 'day of midpoint in month

bExpenseAuth as boolean 'expense authorization yes/no

AAscAddIn as workbook 'where the data is stored
End Type

I'm not a super techie and don't know the "cost" of putting a
workbook object in a user record.

It seems easy to put the AddIn in the record versus:

Sub UpdateA(AAscAddIn as workbook, uOptRec as uOptRec, ..........

to minimize the arguments in the sub/function statement.
Bullen's book says "keep them to no more than 5, usually ... "

But, is it efficient ???
Does a workbook object in a record take up a lot of computer resources?
Is it anything like a "copy" of the .xla file IN the record ?

What are the Pro's and Con's ?.

Thanks, Neal Z


--
Neal Z



 
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
User Defined Record Compile Error Neal Zimm Excel Programming 2 January 8th 08 12:25 PM
Passing Arrays in User Defined Objects Developer of the Caribbean Excel Programming 3 September 10th 05 02:40 AM
Open workbook in user-defined folder pdberger Excel Programming 4 August 30th 05 09:39 PM
User Defined Objects in VBA? McManCSU[_14_] Excel Programming 3 July 29th 05 07:50 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM


All times are GMT +1. The time now is 09:55 AM.

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

About Us

"It's about Microsoft Excel"