ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
JCJohn Casey30/11/2017

Macro worked in Excel 2010, with SolidWorks 2009 API.  I am running the macro again in O365 Excel 2016, SW 2017.

Set swApp = CreateObject("SldWorks.Application")

sFileName = Dir(sPath & "\*.*")

Do While sFileName <> ""

Set swModel = swApp.OpenDoc6(sPath & "\" & sFileName, nDocType, 3, "", nErrors, nWarnings)

{processing}

swApp.QuitDoc (sPath & "\" & sFileName)

sFileName = Dir

Loop

The first SW file in the directory opens.  The second attempt at OpenDoc6 fails with "The object invoked has disconnected from its clients".  Continuing the script (F5/F8) results in "The remote server machine does not exist or is unavailable".

I've seen this posted in the past, but not with this configuration.  Any and all help is appreciated.