I've written that opens a given draft and reads summary info from the file.
I have tested it on multiple computer and it works on some computers. On others it returns a messagebox: "Cannot access specified file. D:\Project\test.dft".
Dim se As Object 'SolidEdgeFramework.Application Dim mDoc As Object 'SolidEdgeFramework.SolidEdgeDocument Dim DFTToOpen As String = "test" Dim FileLocation As String = "D:\Project" se = GetObject(, "SolidEdge.Application") mDoc = se.ActiveDocument mDoc = se.Documents.Open(FileLocation & "\" & DFTToOpen & ".dft")
We are running windows 7 (with windows defender and Norman Anti-virus) I have tested it accross multiple machines with ST4 and ST6
In addition to what Wolfgang mentioned, is this VBA code or Visual Basic .NET? If .NET, you should first test the path using System.IO.File.Exists().
woops, that that FileLocatio(n) a typo (edited it in the code above);
And you're right it the se.ActiveDocument could/should be removed, it's unnecessary but I doubt it causes this error.
I've used this code from an older example where se is defined as an object instead of SolidEdgeFramework.Application I'll update it.
I'm 100% sure the file is there. On all the computer I tested I created the Project folder on the D: drive and added the same test files.
it works flawless on some but gives the 'Cannot access specified file' message on others.
I'm using vb.net (using visual studio 2015)
my assumption still is that the file you want to open is locked by another (crashed) Edge process. Please check before running your program that the file isn't already loaded in the current Solid Edge session you connect to and that there is only 1 Edge process visible in the Task Manager (on tab processes).