What Api function can I use for know the path excel file (.xls)
vinculate to a model (.sldprt) without opening the Solidworks?
Go to SW API downloads and get "Automate interaction with Microsoft
Excel, configurations in SolidWorks documents, and creation of
SolidWorks drawings (VB)". There is a pretty complete discussion of
excel to SW linkages.
Thanks to respond, but there not this the answer to my question.
I want to know if the model has a file tie .xls, before opening it with
And if it is certain, then, to know its Name and Path, to look for it.
To pardon the language to me. I write only a little English.
I am sure my Spanish is worse. :)
Would this be a tie to a design table or to an excel file in general?
We have somebody in the office that insists on making external design
table files. It is a problem when checking in the files. At least in
our case the excel file has the same name as the sldprt file.
Yes, this a tie to a design table.
I am making an automatization in silence of thousands of archives, and
must take the first file "excel"(design table), before opening the
model in SolidWorks. In general Information of the file it is not that
detail. If "SolidWorks" does not find "excel" it shows an error
message that I must avoid.
I need that "SolidWorks" provides that information in a Api function,
as does for example with "GetDocumentDependencies2" because "SoliWorks"
There is no API call that will give you this information before the
model document is opened in SolidWorks. One way to make this work
would be to open the file that you are wanting to work with in Silent
mode, then use DesignTable::FileName to get the location and name of
the design table, then store this path, close SolidWorks model and
Have you made some code where this actually works? I'm having a little
trouble with it myself.
I forgot one thing, you have to have used an external design table
before the call works. So you can use the export design table to save
it out first.
I was trying to program the checks for an external design table and had
some problems with getting DTType = DT.SourceType() to work properly.
DT is a DesignTable object. DTType came up with all kinds of weird
values like 28 and 95. Should be 1,2 or 3 if IIRC.
swPeter would need to first check that an external design table was
used and then use the .FileName method to obtain that information.
You have to make sure that you have the type library and constant
library referenced, or you could declare these constants in your