Winmgmts error on GetObject

Hello,

I get an error when I run the following code:

image

It seem that it can’t open the object winmgmts. Could you please tell me why?

Could you try to replace line 51 with:
oWMI = Application.Application.GetObject etc
(yes, Application. two times)

It still gives me the same error.

Anna.

Then, could you try to replace line 51 with:
oWMI = CreateObject(" etc

I tried only CreateObject (no Application) and I get an error when compiling the code.

Thanks.
Anna.

Which error?