View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
urkec urkec is offline
external usenet poster
 
Posts: 131
Default 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