Common Macro Errors

Common Macro Errors

This KB will show the most common Issues and solutions to Errors when running Macros in Visual



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






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 






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







Verfify 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


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 

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!




  1. 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.


The download of the specified resource has failed.

This error occurs when the server certificate has expired or is invalid.
Preview

Solution

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.

  1. Run MMC.exe as administrator.
  2. Go to File-> Add/Remove Snap-in...
  3. Under Available Snap-Ins select "Certificates, then "Add>"
  4. Select "Computer Account" and click on "Next".
  5. Select "Local Computer" and click on "Finish"
  6. Click on "OK" to close the Add or Remove Snap-ins dialog.
  7. Drill down to Certificates->Trusted Root Certificate Authorities->Certificates.
  8. Right-click on Certificates and select All Tasks->Import...
  9. Local Machine should be selected. Click Next. 

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

  11. Enter the Certificate password and click on Next.
  12. Place the certificate in the "Trusted Root Certificate Authorities" store and click Next.
  13. Confirm and click Finish.
  14. It will be listed under "Intended Purpose" as "Server Authentication".
  15. Exit the Console, optionally saving the settings.

    • Related Articles

    • Macro Server - Info

      What Is Macro Server Central Management of Macros Macros are stored in the database Deployed as a Web Service under IIS Visual Access Controls are Applied to Macros Provides Extensions to VBScript Environment SQL Queries Common VBScript Function ...
    • Macro Server - Release Notes

      v1000.1007 - Resolve Invalid or Expired Credentials Key Exception when calling Client ExecuteNonQuery(), ExecuteQuery() or ExecuteScalar() directly from Macro before any other methods - Server, Client & MacroEditor: ExecuteNonQuery(), ExecuteQuery() ...
    • Running Macro - Windows Security Errors

      Be sure when testing on a Server environment that the Internet Explorer Enhanced Security Configuration is set to off for both Administrators and Users. This shoudl include Terminal Server Environments as well. Security should be set to off for users ...
    • XML Error when running the Order Total w/ Tax macro for Colorado orders (possibly other states)

      When taxing orders in Colorado, you may receive the following error: This is due to a Tax Name having an ampersand (&) within it. To correct this issue, Launch the MacroServer Macro Editor, log in, select the SRITAXOT macro, and edit the SQL: ...
    • SmartViews Sync Error - "Cannot find column __"

      If this error is ever encountered, update SmartViews as this was corrected in v452.1800