MemoryFree

D

Daminc

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
 
D

Daminc

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

Daminc

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

VBA for Dependents shortcut menu 0
Maximum Memory Issue Excel 2003 1
Workbook reminder 0
Mistery Link 1
Help. Sumproduct Data Type Mismatch Erro 3
remove crlf 1
Array to Multiple Arrays 3
Adjusting alogarithm 18

Top