I'm new to these forums and to coding so please don't eat me alive if I come across as a complete amateur
I want to pull information from my computer and then add this information to the Excel Sheet. How do I do this? I have a column in B in Excel Sheet as that's were I'd like the information to go. Here is my code:
If I need to provide anything more or something is unclear please let me know. I'd let to get this resolved as quick as possible as time is pressing for this.Code:Option Explicit 'declare variables Dim objDomain, objFSO, objExcel, objSheet, objWMI, objItem Dim userSheet, intRow, colItem Dim strComputer, strIP 'assign spreadsheet to variables userSheet = "c:\Computers.xlsx" 'connect to Excel spreadsheet Set objExcel = Createobject("Excel.Application") 'creating a connection to file system object Set objFSO = CreateObject("Scripting.FileSystemObject") 'open spreadsheet Set objSheet = objExcel.Workbooks.Open(userSheet) intRow = 3 'loop that gets data from cells Do Until objExcel.Cells(introw,1).Value = "" strIP = Trim(objExcel.Cells(introw, 1).Value) strComputer = strIP WScript.Echo(strComputer) Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItem = objWMI.ExecQuery("Select * from Win32_OperatingSystem",,48) For Each objItem In colItem WScript.Echo "Name " & objItem.Name Next intRow = intRow + 1 Loop WScript.Quit![]()





Reply With Quote
