ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How much RAM in system? (https://www.excelbanter.com/excel-programming/386162-re-how-much-ram-system.html)

John

How much RAM in system?
 
try =INFO("memavail")
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"CLR" wrote:

Hi All.........
Could someone please give me the code to return the amount of RAM installed
on the system?

TIA
Vaya con Dios,
Chuck, CABGx3



urkec

How much RAM in system?
 
Here's another approach:


Sub SysInfo()

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")


With Sheets(1)

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem In colSettings

Cells(1, 1) = "OS Name: "
Cells(1, 2) = objOperatingSystem.Name

Cells(2, 1) = "Version: "
Cells(2, 2) = objOperatingSystem.Version

Cells(3, 1) = "Service Pack: "
Cells(3, 2) = objOperatingSystem.ServicePackMajorVersion _
& "." & objOperatingSystem.ServicePackMinorVersion

Cells(4, 1) = "OS Manufacturer: "
Cells(4, 2) = objOperatingSystem.Manufacturer

Cells(5, 1) = "Windows Directory: "
Cells(5, 2) = objOperatingSystem.WindowsDirectory

Cells(6, 1) = "Locale: "
Cells(6, 2) = objOperatingSystem.Locale

Cells(7, 1) = "Available Physical Memory: "
Cells(7, 2) = objOperatingSystem.FreePhysicalMemory

Cells(8, 1) = "Total Virtual Memory: "
Cells(8, 2) = objOperatingSystem.TotalVirtualMemorySize

Cells(9, 1) = "Available Virtual Memory: "
Cells(9, 2) = objOperatingSystem.FreeVirtualMemory

Cells(10, 1) = "Size stored in paging files: "
Cells(10, 2) = objOperatingSystem.SizeStoredInPagingFiles

Next

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")

For Each objComputer In colSettings

Cells(11, 1) = "System Name: "
Cells(11, 2) = objComputer.Name

Cells(12, 1) = "System Manufacturer: "
Cells(12, 2) = objComputer.Manufacturer

Cells(13, 1) = "System Model: "
Cells(13, 2) = objComputer.Model

Cells(14, 1) = "Total Physical Memory: "
Cells(14, 2) = objComputer.TotalPhysicalMemory

Next

End With

End Sub

Using simmilar technique you can get most of hardware and software info

--
urkec


"CLR" wrote:

Thanks for the response John, but that's not what I'm after.
I'm trying to identify the total amount of Installed RAM...........

Vaya con Dios,
Chuck, CABGx3



"John" wrote:

try =INFO("memavail")
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"CLR" wrote:

Hi All.........
Could someone please give me the code to return the amount of RAM installed
on the system?

TIA
Vaya con Dios,
Chuck, CABGx3



CLR

How much RAM in system?
 
OK, urkec.....just wanted to get back and let you know I got it sorted. I
used little pieces of your code in my format and all went well. I sure do
appreciate you helping me with this......

BTW, something is wrong with this thread. I can see it here, but cannot get
it at home on msmsnews, or even on Google. The threads on both sides of
this one show up, but not this one.......gremlins maybe.


Thanks again,
Vaya con Dios,
Chuck, CABGx3




"CLR" wrote:

Hi urkec............Thank you very much, that works really well. I had sent
you a thank-you note some time back, but I still don't see it posted. I
guess the Ether-Gods got it somehow. Anyway, what I wanted to ask further is
if you could be so kind as to trim that down some for my need. What I'm
trying to do in Excel 97 is.......

Application.GoTo Reference:="R65000C4"
Selection.End(xlUp).Offset(1, 0).Select
Selection.Value = "TOTAL RAM HERE"

Application.GoTo Reference:="R65000C5"
Selection.End(xlUp).Offset(1, 0).Select
Selection.Value = "FREE RAM HERE"

I do very much appreciate your help.....

Vaya con Dios.
Chuck, CABGx3



"urkec" wrote:

Here's another approach:


Sub SysInfo()

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")


With Sheets(1)

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem In colSettings

Cells(1, 1) = "OS Name: "
Cells(1, 2) = objOperatingSystem.Name

Cells(2, 1) = "Version: "
Cells(2, 2) = objOperatingSystem.Version

Cells(3, 1) = "Service Pack: "
Cells(3, 2) = objOperatingSystem.ServicePackMajorVersion _
& "." & objOperatingSystem.ServicePackMinorVersion

Cells(4, 1) = "OS Manufacturer: "
Cells(4, 2) = objOperatingSystem.Manufacturer

Cells(5, 1) = "Windows Directory: "
Cells(5, 2) = objOperatingSystem.WindowsDirectory

Cells(6, 1) = "Locale: "
Cells(6, 2) = objOperatingSystem.Locale

Cells(7, 1) = "Available Physical Memory: "
Cells(7, 2) = objOperatingSystem.FreePhysicalMemory

Cells(8, 1) = "Total Virtual Memory: "
Cells(8, 2) = objOperatingSystem.TotalVirtualMemorySize

Cells(9, 1) = "Available Virtual Memory: "
Cells(9, 2) = objOperatingSystem.FreeVirtualMemory

Cells(10, 1) = "Size stored in paging files: "
Cells(10, 2) = objOperatingSystem.SizeStoredInPagingFiles

Next

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")

For Each objComputer In colSettings

Cells(11, 1) = "System Name: "
Cells(11, 2) = objComputer.Name

Cells(12, 1) = "System Manufacturer: "
Cells(12, 2) = objComputer.Manufacturer

Cells(13, 1) = "System Model: "
Cells(13, 2) = objComputer.Model

Cells(14, 1) = "Total Physical Memory: "
Cells(14, 2) = objComputer.TotalPhysicalMemory

Next

End With

End Sub

Using simmilar technique you can get most of hardware and software info

--
urkec


"CLR" wrote:

Thanks for the response John, but that's not what I'm after.
I'm trying to identify the total amount of Installed RAM...........

Vaya con Dios,
Chuck, CABGx3



"John" wrote:

try =INFO("memavail")
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"CLR" wrote:

Hi All.........
Could someone please give me the code to return the amount of RAM installed
on the system?

TIA
Vaya con Dios,
Chuck, CABGx3




All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com