Getting MAXSURF to talk to other packages can be a really powerful thing. We can use it to generate reports, iterate and optimise designs or streamline exports.
However, sometimes getting MAXSURF COM to work needs a couple of little tricks. These come down to letting your external package (Excel, Word, VB Script etc) to know where to find MAXSURF.
There are two steps to ensuring the correct reference.
- The VBA script normally uses Early Binding (links Excel to MAXSURF before we start the script), for this, we need to create a Reference and a Name that we'll use to refer to MAXSURF. When the version of MAXSURF changes, the new version will have a new file path and that old reference will be out of date.
To fix this up, all we need to do is remove the old reference and recreate it to the new and correct executable. In Excel / Word VBA you'll find it under Tools | References
So that fixes the problem if Excel is looking for MAXSURF in the wrong spot. However, there is also the chance that the Index, known as the Registry is not up to date.
The steps to fix this are also pretty simple.
- Open the Command Prompt as ADMNISTRATOR (the admin part is important!)
- Run these two commands. First to remove the old entry out of the Registry, then to add the new entry back in.
"C:\Program Files\Bentley\Offshore\MAXSURF CONNECT Edition V23\MaxsurfModeler64.exe" /unregserver
"C:\Program Files\Bentley\Offshore\MAXSURF CONNECT Edition V23\MaxsurfModeler64.exe" /regserver
Once you've done this step, go back and do the first step again.
If that is all a bit confusing, here is a video stepping through it slowly.
Troubleshooting MAXSURF COM Interface - YouTube