LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Windows Query working on some computer, and not working on others?!?

Hi all,

I have this small script to get the domain of the PC:
__________________________________________________ ____________________
Dim WMIService As Object
Set WMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\.\root\cim v2")

Dim WindowsQuery As Object
Set WindowsQuery = WMIService.ExecQuery("Select * from
Win32_ComputerSystem")

Dim PC As Object
Dim PD As String

For Each PC In WindowsQuery
PD = PC.Domain
Next
__________________________________________________ ____________________

But, on computers it work, and on other computers, the script return runtime
error 430 in the "For Each PC" line?!?

All computers are running "WinXP Pro 32-bit"???

And it doesn't matter, if I'm requesting Domain or other PC information - it
still work on some computers, and not on others?!?

What am I missing???


TIA...


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro not working on different computer carl Excel Programming 2 October 16th 08 10:46 PM
Working with Functions on French Computer Cazzy123 Excel Worksheet Functions 3 August 7th 08 11:17 AM
Save as Macro working for one computer but not the other? Infinity[_3_] Excel Programming 6 March 29th 06 10:30 AM
Sendmail not working when computer is locked [email protected] Excel Programming 0 August 31st 05 10:29 AM
DB not working on other computer lyndac New Users to Excel 1 July 16th 05 08:45 PM


All times are GMT +1. The time now is 03:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"