I have an application in Excel VBA which did some jobs related with Navisworks model by COM API. Now I wanted to save the model to lower version, but I do not find an API in COM.
.NET API allows Document.SaveFile allows you to save the file to specific version. While VBA does not support .NET. however you could produce a .NET Automation application, and a .NET plugin. In plugin, use Document.SaveFile to save to specific version. The Automation executes the plugin. In Excel, run the Automation (exe) with the parameter of the source file.
This sounds a little awkward. The better solution is to create a DocumentControl application (without viewcontrol), do the similar job. A DocumentControl application is a light process which does not require to start Navisworks standard process. In addition, you do not need to write a plugin.
The following is the core code of a DocumentControl application. It iterates each file from the argument, saves them to version 2014. Assume the source files are available in the path.
staticvoid Main(string args)
if (args.Count<string>() > 0)
//single document mode
//initialize application control
//create a DocumentControl
DocumentControl documentCtrl = new DocumentControl();
//open a document
foreach (string fullfilename in args)
string oldName = System.IO.Path.GetFullPath(fullfilename);
string newfullfilename = oldName + "-lowerversion" +".nwd";
//save to a lower version
//terminate application control
The VBA code executes the application with the parameters.
Public Sub StartNWApp_WithArgument()
strProgramName = "C:\temp\Nw_Without_View_control\bin\Debug\Nw_Without_View_control.exe"
Call Shell(strToExecute, vbNormalFocus)