Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VBScript problem upgrading from WIn7 to Win10 (Enterprise)

VBScript problem upgrading from WIn7 to Win10 (Enterprise)

VBScript problem upgrading from WIn7 to Win10 (Enterprise)

Hi all, first post for an old scientist with minor knowledge of computer programming; I may not use the correct terminology but have tried to explain procedures and my problem as best I can.

Our research institute is in the process of upgrading from Win7 to Win10 Enterprise. We use a digital data logging software (Labchart V7 by Adintruments) for which we have developed custom MACROS, based upon VBscript. The manufacturer cannot provide further support as we are using the MACROS well beyond what was intended for the program. Essentially, the VBscript MACROS call a document (HTML page from IE) to enable the user to either: (1) enter data which then writes back to a spreadsheet within the Labchart program (I call this a "one layer" MACRO, or (2) prompts the user for a selection, which then calls another VBscript MACRO for the user to enter data and write back to Labchart (I call this a "secondary or tiered" MACRO. This strategy was chosen to minimize the number of "buttons" on the GUI. An example would be "Blood Test" MACRO. When this is selected by user, a HTML page opens with a list of buttons to select for each of the types of blood tests.

The problem is with the "tiered" MACROS. They work in Win7 with a standard user logged in- it was necessary for our IS folks to modify IE security settings related to ActiveX and scriptlets to get things to work. On Windows 10, despite having the same IE security settings, I can only get the "tiered": MACROS to work is the Labchart program is run as administrator; "one layer" MACROS work fine for standard user. Our IS folks are hesitant to provide admin access to the various users in our team just to be able to make the program function in Win10.

Some additional information which may be useful. Upon starting the Labchart program, we run an initialize MACRO which sets up a folder in the users\public for the various HTML files which the lab chart program calls when running a MACRO. I have tried another local folder on computer and opened up access for that folder but no luck; thought it may have to do with Win10 read/write access to folder.

An example of a tiered MACRO is below. In Win10, when a button is selected, the secondary HTML page does not appear (nothing happens). I have checked that the docs are located in the directory; again, this works for Win7.Based upon my testing (and limited knowledge) I wonder if there is a Win10 or IE security setting which I cannot change to make MACROS function for standard user.

I am hoping that someone in the community could provide any guidance (ie. ideas for further tests) to define my problem. I can provide further files if needed for troubleshooting.

Thanks in advance!


Sub Test_Menu () 'Macro used to create a menu to access scripts for all blood tests

'First Line hands Error catching over to the user (Lines such as Err.Number <> 0 means there was an internal error.) If a script isn't behaving as it is
'supposed to, comment out the first line and let it run. It should tell you which line is causing an error if it can find one.
On Error Resume Next

'An internet object is created and is assigned to navigate to the local html file that serves as a template for the Test menu
Set objExplorer = CreateObject("InternetExplorer.Application")
filePath = Doc.Path + "ScriptFiles\HTML\test Menu.htm"
objExplorer.Navigate "file:///" + filePath

'If objExplorer can not find the local html file, it is likely that the script file has not been created and so an error message is shown
if Err.Number <> 0 Then
call msgbox("Could not find Script files! Please be sure that the Script Files Folder is located " & chr(10) & " in the same folder and that this file has already been saved as a Data File")
Exit Sub
End if

'Formats the IE page for viewing on the computer
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 400
objExplorer.Height = 500
objExplorer.Left = 700
objExplorer.Top = 250
objExplorer.Visible = 1

'The following two lines help to ensure the IE page pops up (This two lines may not be necessary, but I have included them just in case
Set objShell = CreateObject("Wscript.Shell")
objShell.AppActivate objExplorer.Name

'While the IE page is up, the script checks every 0.25 seconds to see if either the OK button or cancel button is clicked
Do While (objExplorer.Document.Body.All.OKClicked.Value = "")
Call WaitFor(0,0,.25)
'Clicking the X-button creates an error, so this code ensures that the macro is exited when the x button is clicked
if Err.Number <> 0 then
exit sub
End if

'Whichever button was clicked is grabbed from the HTML file and stored to the response variable before then objExplorer object is removed
response = objExplorer.Document.Body.All.OKClicked.Value
if Err.Number <> 0 then exit sub

'Depending upon the response, the proper macro is called
Select Case response
Case "ACT"
Call Doc.Macros.ACT ()
Case "CG8"
Call Doc.Macros.CG8 ()
Case "CG4"
Call Doc.Macros.CG4 ()
Case "CHEM8"
Call Doc.Macros.Chem8 ()
Case "HEMOX"
Call Doc.Macros.HEMOX ()
Case "Glucose"
Call Doc.Macros.GLU ()
Case "PCV"
Call Doc.Macros.PCV ()
Case "OSMO"
Call Doc.Macros.Osmolarity ()
Case "Ultrasound"
Call Doc.Macros.Ultrasound()
Case "Cancelled"
Exit sub
Case Else
Exit Sub
End Select

End Sub

Replies continue below

Recommended for you

RE: VBScript problem upgrading from WIn7 to Win10 (Enterprise)

>when a button is selected,

Might be useful to see the code that is called when on of the Menu buttons is selected.

Also, comment out On Error Resume Next, as this may well be masking what is really going on when you say 'nothing happens'

(On Error Resume Next should really only be used v carefully and sparingly)

RE: VBScript problem upgrading from WIn7 to Win10 (Enterprise)

Hi strongm and thanks for offering your expertise.

Test settings: Win10 (Enterprise), Standard User, "On Error Resume Next" removed as you recommended

Result : The macro, "Test Menu" contains errors: Line 21
Line 21 objExplorer.StatusBar = 0

The program (Labchart) is still able to call up the primary HTML file (test menu) despite error. However when a button is selected from the test menu, the secondary HTML window does not come up (I presume because the MACRO has stopped running due to error)

I have attached one of the HTML files that is called when selecting a button. In this case CG8 which is located at left top of test menu list.

Just to clarify. In Win7, MACROS work for a standard user. I can only get MACROS to work in WIN10 when program (labchart)is run as administrator)

RE: VBScript problem upgrading from WIn7 to Win10 (Enterprise)

Have you checked the properties of all the HTM files involved. DO any of them look like:

If so, tick the Unblock box

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close