Summary:
This KB will show the most common Issues and solutions to Errors when running Macros in Visual
VBScript Standard Error
This is a standard VBscript error, review the Visual ERP Macros and see what the end user has written, or may have broken. If this macro calls an SRI Macro, make sure that the macro exists in the VTGMacro table.
Issue 1: Red Exclamation Icon and blank box when running a Macro
Solution 1
Make Sure the Visual Mfg VSCRIPT.dll is registered
Open CMD prompt using Run as Administrator
Find the Vscript.dll on your machine this is the Visual Client Directory
In this example its in C:\Visual\localapps\VMFG10
Your location may be different

Now type in the cmd window REGSVR32 "Path to Vscript.dll in Visual client directory"
Below is an example based on the location above

Close the Visual Window and reopen and test the macro the ! Blank screen should be gone

Solution 2
If the error persists, make sure the Visual Client Directory Has Modify Permissions for users
Issue 2: The Remote Name Could not be Resolved
Problem: Active Object Error when running a Macro
Solution 1
Check to make sure the Remote Name\ Macro Server name is correct within the Macro
In this scenario we had a typo in the Macro Stub

Issue 3: Active X Component Can't create Object
When running a Macro you get an error about Active X
Solution 1
Verify you have the correct version of the Macro Server Client Installed for your Environment.
On the Web server hosting SRIMacroServer you can verify the Client Install msi
below is an example of the Installation Path of Macro Server (Drive letter may be different)
Older Macro Server Clients are not Forward Compatible
.Net 462
MacroServer Version 10 and later
.Net 2.0 Client
MacroServer V9 and earlier
Step 1:
Verify the Client Install exists as COM in the registry
Open a CMD Window and run the below query
reg query HKLM\SOFTWARE\Classes /s /f VTG.Loader.dll
Note: A single version (v1.1.5000.0) is installed
Note: Latest Version Below
Step 2: Run the Macro Script
Note: You must EDIT with the proper Server Name
- dim lib, scriptName, serverName
- '_______****User Entry Required****________
- 'Define Script and Server
- scriptName = "FAKE_TEST"
- serverName = "localhost"
- '_____________________________________
- set lib = createobject( "VTG.Loader.Managed" )
- msgbox lib
- lib.ServerUrl = "http://" & serverName & "/SRIMacroServer"
- dim util
- msgbox "Activate"
- lib.ActivateObject "util","VTG.Macro.Net.dll","VTG.Macro.Net.Lib"
- msgbox "Activated"
- set util = lib.GetObject ( "util" )
- msgbox util.ToString()
- util.ServerURL = lib.ServerURL
- executeglobal util.Script(scriptName)
- msgbox util.ServerInfo
- util.sql = "SELECT COUNT(1) FROM dbo.PART_SITE_VIEW"
- msgbox "Part Count: " & util.executescalar
Issue 4: The maximum message size quota for incoming messages (####) has been exceeded.
This error occurs when data between the client and Macro Server exceeds the default maximum size (64 Kb).

Solution 1
In the macro stub, before the Macro Server macro is executed, the maximum size must be increased.
The setting of the util.MaxReceivedMessageSize must happen directly after setting util.ServerURL and before any other statement that causes a request to the server.
This is because setting util.ServerURL resets MaxReceivedMessageSize to the default (65536) and the first statement that sends a request to the server will set the parameter on the connection.
The connection's parameter cannot be changed once the connection is established!
- util.MaxReceivedMessageSize = CDbl(util.MaxReceivedMessageSize)*2
It's recommended to increase in minimal steps (by 1) to find the least needed size increase as to not overload the server.
You must close / re-open the Visual window you're running the macro from for the change to take effect.
Issue 5: The download of the specified resource has failed.
This error occurs when the server certificate has expired or is invalid.
Solution 1
If the Macro Server is using a self-signed certificate, the certificate will need to be installed on each client machine in the "Trusted Root Certificate Authorities" store.
- Run MMC.exe as administrator.
- Go to File-> Add/Remove Snap-in...
- Under Available Snap-Ins select "Certificates, then "Add>"

- Select "Computer Account" and click on "Next".

- Select "Local Computer" and click on "Finish"

- Click on "OK" to close the Add or Remove Snap-ins dialog.
- Drill down to Certificates->Trusted Root Certificate Authorities->Certificates.
- Right-click on Certificates and select All Tasks->Import...

- Local Machine should be selected. Click Next.

- Browse to the certificate file (.pfx, etc.), select it, and click on Next on the Import Wizard.

- Enter the Certificate password and click on Next.

- Place the certificate in the "Trusted Root Certificate Authorities" store and click Next.

- Confirm and click Finish.

- It will be listed under "Intended Purpose" as "Server Authentication".

- Exit the Console, optionally saving the settings.