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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul MacDonaldDirector, Information SystemsCommented:
*Code NOT attached.
0
ian varAuthor Commented:
0
slightwv (䄆 Netminder) Commented:
On the Windows 7 machine, open up Powershell window and see what this returns:
(Get-WmiObject -Class Win32_VideoController).VideoModeDescription;
0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

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 PrewIT / Software Engineering ConsultantCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bill PrewIT / Software Engineering ConsultantCommented:
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 PrewIT / Software Engineering ConsultantCommented:
Welcome, glad that helped.


»bp
0
Bill PrewIT / Software Engineering ConsultantCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.