#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default MemoryFree


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
--------------------


--
Daminc
------------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=515267

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default MemoryFree

Hi Daminc,

See the DecisionModels site at:

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

---
Regards,
Norman



"Daminc" wrote in
message ...

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
--------------------


--
Daminc
------------------------------------------------------------------------
Daminc's Profile:
http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=515267



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default MemoryFree


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?


--
Daminc
------------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=515267

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default MemoryFree

You can use the FileLen function. E.g.,

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



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

"Daminc"
wrote in message
...

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?


--
Daminc
------------------------------------------------------------------------
Daminc's Profile:
http://www.excelforum.com/member.php...o&userid=27074
View this thread:
http://www.excelforum.com/showthread...hreadid=515267



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default MemoryFree


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
--------------------


--
Daminc
------------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=515267



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
Application.MemoryFree Mike Archer[_3_] Excel Programming 1 March 2nd 05 09:06 PM


All times are GMT +1. The time now is 12:45 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"