Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

MemoryFree

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daminc - 22 Feb 2006 11:47 GMT
Hi everyone,

during my practicing I've found:

Code:
--------------------
   
 Application.MemoryFree
 Application.MemoryTotal
 Application.MemoryUsed
 
--------------------

When I used this it gives me some nice numbers but the MemoryFree
always remains the same.

If I add a workbook, worksheets...whatever the MemoryTotal and
MemoryUsed increased but the MemoryFree doesn't so how is this
information processed? I want to be able to get the memory weight of a
worksheet or workbook that is being worked on via vba if I can.

Just in case it helps:

Code:
--------------------
   Sub version()
 
 Dim wrkbk As Variant
 Dim User As Variant
 Dim Vers As Variant
 Dim memfree As Variant
 Dim memtotal As Variant
 Dim memused As Variant
 
 
 wrkbk = Application.ActiveWorkbook.Name
 User = Application.UserName
 Vers = Application.version
 memfree = Application.MemoryFree
 memtotal = Application.MemoryTotal
 memused = Application.MemoryUsed
 
 MsgBox _
 "Memory Total: " & memtotal & Chr(13) & _
 "Memory Used: " & memused & Chr(13) & _
 "Memory Free: " & memfree & Chr(13) & _
 Chr(13) & _
 "Name of workbook: " & wrkbk & Chr(13) & _
 "Name of User: " & User & Chr(13) & _
 "Version of VBA: " & Vers
 
 End Sub
--------------------

Signature

Daminc

Norman Jones - 22 Feb 2006 12:13 GMT
Hi Daminc,

See the DecisionModels site at:

       http://www.decisionmodels.com/memlimitsb.htm

---
Regards,
Norman

> Hi everyone,
>
[quoted text clipped - 48 lines]
>  End Sub
> --------------------
Daminc - 22 Feb 2006 13:20 GMT
B*gger :(

Cheers Norman for the heads up.

Do you know of anyway of getting the size attribute of the file.

e.g. workbook.name   size = 500kb

as seen in the folders?

Signature

Daminc

Chip Pearson - 22 Feb 2006 13:46 GMT
You can use the FileLen function. E.g.,

Debug.Print FileLen("H:\book1.xls")

Signature

Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

> B*gger :(
>
[quoted text clipped - 6 lines]
>
> as seen in the folders?
Daminc - 22 Feb 2006 14:47 GMT
Thanks Chip,

this works:

Code:
--------------------
   Sub version()
 
 Dim wrkbk As Variant
 Dim User As Variant
 Dim Vers As Variant
 Dim actwrkbk As Variant
 Dim sizeoffile As Long
 
 wrkbk = Application.ActiveWorkbook.Name
 User = Application.UserName
 Vers = Application.version
 actwrkbk = ActiveWorkbook.FullName
 sizeoffile = FileLen(actwrkbk)
 
 MsgBox _
 "Size of File: " & sizeoffile & " bytes" & Chr(13) & _
 Chr(13) & _
 "Name of workbook: " & wrkbk & Chr(13) & _
 "Name of User: " & User & Chr(13) & _
 "Version of VBA: " & Vers
 
 End Sub
--------------------

Signature

Daminc

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.