I have piece of code that produces a progress bar while another piece of code is running it works fine on a windows 8.1 machine but when I try and run it on windows 7 machine I get a Invalid use of nu

I have piece of code that produces a progress bar while another piece of code is running it works fine on a windows 8.1 machine but when I try and run it on windows 7 machine I get a Invalid use of null:"SPLIT" If I remove the last line it will run but the progress bar is half off the screen.

Can anyone help me please . Code attached
ian varAsked:
Who is Participating?
 
Bill PrewCommented:
Not sure if it will solve your problem but worth a try.  Adjust line 75 as follows and try it.

For Each objItem In colItems: If objItem.VideoModeDescription <> "" Then VMD = objItem.VideoModeDescription End If: Next

Open in new window


»bp
0
 
Paul MacDonaldDirector, Information SystemsCommented:
*Code NOT attached.
0
 
ian varAuthor Commented:
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
slightwv (䄆 Netminder) Commented:
On the Windows 7 machine, open up Powershell window and see what this returns:
(Get-WmiObject -Class Win32_VideoController).VideoModeDescription;
0
 
ian varAuthor Commented:
Tried this but didn't get a result.
Just got this
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\j.b.motor> (Get-WmiObject -Class Win32_VideoController).VideoModeDescription;
PS C:\Users\j.b.motor>
0
 
ian varAuthor Commented:
When I ran windows powershell on my windows 8.1 I got this

Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. All rights reserved.

PS C:\Users\Iain> (Get-WmiObject -Class Win32_VideoController).VideoModeDescription;
1366 x 768 x 4294967296 colors
PS C:\Users\Iain>
0
 
slightwv (䄆 Netminder) Commented:
>>Tried this but didn't get a result.

Well, that is why you are getting the error.  You are passing a null to SPLIT.

My guess is the video card on that box isn't providing the necessary information.  Remember it's only a guess.  I'm not a Windows Internals guy.

It appears there are many ways to query video related information from the WMI.  I would dig into those.

Can you rewrite the code to use ScreenHeight and ScreenWidth?
0
 
Bill PrewCommented:
And for what it's worth, if you really need some VBS running but also including a UI, you should take a good hard look at HTA's.

Or better yet move on to PowerShell which can have GUI interfaces...


»bp
0
 
ian varAuthor Commented:
Thanks very much the replacement line to line 75 worked fine. Thanks again
0
 
Bill PrewCommented:
Welcome, glad that helped.


»bp
0
 
Bill PrewCommented:
I you need any help with how to close this question take a look at:

Experts Exchange | How do I close my question?

Welcome to Experts Exchange!


»bp
0
 
ian varAuthor Commented:
Thanks for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.