Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

how to fix this VBA code

Avatar of Flora Edwards
Flora EdwardsFlag for Sweden asked on
3 Comments1 Solution73 ViewsLast Modified:
i am trying to put this in array of cells but it overwrites other values

i want the objQuickFix headers to appear in Columns

like this Computer:   "Description: " "Hot Fix ID: "  as header of columns and then the data to put in rows.

i tried the below code but it overwrites the previous data and it is a mess.

 Sub Test()
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
    ("Select * from Win32_QuickFixEngineering")
For Each objQuickFix In colQuickFixes
    Cells(1, 1).Value = "Computer: "
    Cells(2, 1).Value = objQuickFix.CSName
    Cells(1, 2).Value = "Description: "
    Cells(2, 2).Value = objQuickFix.Description
    Cells(2, 3).Value = "Hot Fix ID: "
    Cells(3, 3).Value = objQuickFix.HotFixID
    Cells(3, 4).Value = "Installation Date: "
    Cells(4, 4).Value = objQuickFix.InstallDate
    Cells(4, 5).Value = "Installed By: "
    Cells(5, 5).Value = objQuickFix.InstalledBy
End Sub
Avatar of Rgonzo1971
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers