Follow

Surfer Automation Errors

A list of errors sometimes seen with Surfer automation is provided below. Click the error message you're seeing to view information about resolving the error.

 

 "ActiveX Automation: no such property or method" or "ActiveX Automation: no such named parameter"

This error is usually caused by a typo in one of the properties or method in the line indicated by the error. For example, this line would generate that error:

Wks.Cell("C1").Copy

This is because there is a typo in the method. The method "Cell" should be "Cells", as seen in the WksRange object properties and methods.

 

If there are no typos in the line, this error could also be caused by using new properties or methods with an older version of Surfer. For example, this line would generate that error when run in Surfer 12:

MapFrame.CoordinateSystem = "World Geodetic System 1984"

This is because the CoordinateSystem property for the MapFrame object was added in Surfer 13. There is no such property or method in Surfer 12 (or prior).

 

If you are certain the line doesn't contain typos and is supported by the version of Surfer you are using, please email a simplified script that can be run in Scripter that exemplifies the problem to surfersupport@goldensoftware.com.

 

"ActiveX Automation: Server Could Not Be Found" or "ActiveX Automation: Server Cannot Create Object"

The (10096) ActiveX Automation: server could not be found error and the ActiveX Automation: server cannot create object error typically occur when Surfer and/or Scripter are not properly registered on the computer. When the programs are not registered properly on the computer, it is usually an indication that the programs have not been run interactively, that lack of user permissions are preventing the proper registry items from being created, that multiple versions of Surfer are installed on the computer and are interfering with registry item creation, or that Surfer was installed improperly to a network location.

 

First, be sure that Surfer was installed either directly on the workstation it is being called from, or from the workstation to a network location. If it was installed directly on the network server, it cannot be called via automation from a workstation because the necessary registry items are not created on the workstation. If this is the case, you will need to talk to your IT personnel to get Surfer installed on your local workstation so you can call it via automation.

 

Second, check to be sure Surfer was opened prior to trying to access it via automation. Surfer must be opened interactively at least once in administrator mode prior to calling it via a script. Please try these steps:

  1. Right-click the Surfer icon or EXE file.
  2. Click Run as administrator.
  3. Close Surfer.
  4. Right-click the Scripter icon or EXE file.
  5. Click Run as administrator.
  6. Close Scripter.
  7. Then try running the script.

 

If you still get the error, please make sure there is only one version of Surfer installed on the computer, then repair the installation. To do this:

  1. Log on to the computer as an administrator.
  2. If Surfer or Scripter is open, close the program.
  3. Navigate to the Windows Control Panel and click Uninstall a program.
  4. In the Uninstall or change a program window, uninstall any other older versions of Surfer, including the demo versions, that are installed on the computer (if any). If no other version of Surfer is installed on the computer, skip this step.
  5. Repair the current Surfer installation by selecting it, clicking Change, selecting Repair and clicking Next. The installer will run the repair.
  6. When the installer is finished, check the option to run Surfer now and click Finish.
  7. After Surfer opens, close the program.
  8. Try running the script now.

 

If you still get the message, you can try manually registering Surfer before attempting to run the script. To do this:

  1. Close Scripter and Surfer.
  2. Click the Windows Start button.
  3. In the search box (which is also the Run command), enter the path to the surfer.exe file in quotes followed by /register. For example: "C:\Program Files\Golden Software\Surfer 15\surfer.exe" /register.  Be sure to include the quotation marks, and be sure the path to surfer.exe goes to wherever Surfer is installed, if it was not installed to the default directory.
  4. Press ENTER on the keyboard. If the command is successful, it will appear as if nothing happened.
  5. Now re-run Surfer and Scripter as administrator. Right-click the Surfer icon or EXE file.
  6. Click Run as administrator.
  7. Close Surfer.
  8. Right-click the Scripter icon or EXE file.
  9. Click Run as administrator.
  10. Close Scripter.
  11. Try running the script now.

 

If both Surfer and Scripter (or whatever program you are using to call Surfer) are set to run as administrator and you still get the error, other reasons could include:

  1. There is a problem running Surfer when PC Anywhere runs at startup.  If you are running PC Anywhere, you can work around the problem by removing PC Anywhere from the startup menu, restart the computer and then starting PC Anywhere manually after the computer restarted. 
  2. If that also doesn’t help, you can try turning the UAC (User Account Control) off via the Control Panel | User Accounts. You will need to reboot after UAC is turned off.

 

If you still get the error, please send an email to surfersupport@goldensoftware.com with the version of Surfer you are using (File | About Surfer), your serial number or product key and the steps you have tried (above).

 

"ActiveX Automation: No Object Currently Active"

This error means that the script calls a currently active instance of Surfer and it can’t find one. For example, the script begins with:

Set SurferAppGetObject(, "Surfer.Application")

 

The “GetObject” command calls a currently open instance of Surfer. If there is no Surfer window open, then the error is generated. You can either open Surfer first and then run the script, or you can change the script to create a new instance of Surfer instead of getting an existing instance:

Set SurferApp = CreateObject("Surfer.Application")

 

The code below can also be used to check for an open instance of Surfer and if one is not found open a new instance.

Function SurferApplication() 
On Error Resume Next
Set SurferApplication = GetObject( ,"Surfer.Application")
If Err.Number <> 0 Then
Set SurferApplication = CreateObject("Surfer.Application")
End If
On Error GoTo 0
End Function

Sub Main

'Define the Surfer application object and create a new plot

Dim SurferApp As Object
Set SurferApp = SurferApplication()

 

 "Unable to open <file path>"

If you're running a script where you've defined your file name and file path as a single variable (i.e. file$ = "c:\temp\filename.dat"), make sure that the file exists in that directory, and there are no typos. Neither the name nor the path are case-sensitive.

 

If you're running a script where you've defined your file name and file path as two separate variables (i.e. filepath$ = "c:\temp\" and filename$ = "filename.dat"), the above could still be the issue, but another cause could be forgetting the slash at the end of the file path. If this has happened to you more than once, I suggest adding the following line to your script, after defining the file name and file path variables, but before using them:

If Right(filepath$,Len(filepath$)-(InStrRev(filepath$,"\")-1))<>"\" Then filepath$=filepath$+"\"

This checks the end of the file path for the \ character, and adds it if it doesn't find it.

 

Related Articles:

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.