Yes it is working find here for VBA
Public Function fctGetOwner(strFile As String) As String
Dim objWMIService As Object
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colitems = objWMIService.ExecQuery _
("ASSOCIATORS OF...
If you want your macro to run on existing data in your worksheet, use : SpecialCells(xlLastCell)
This line will delete all data recorded in your WS
Worksheets("WS").Range("A1", .Cells.SpecialCells(xlLastCell)).ClearContents
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.