Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenDoc call fails!

Status
Not open for further replies.

jwalz

Computer
Apr 22, 2003
10
0
0
US
I am trying to write a macro that will go through all of my drawing files and extract the BOM information. When I execute the OpenDoc method the drawing opens, but I get the following error at the end of the method line execution: Run-time error '91': Object variable or With block variable not set and the call fails. I hope that someone can point out what I am doing wrong. Here is my code:
....
Set swApp = CreateObject("SldWorks.Application")
swModel = swApp.OpenDoc6(infile, swDocDRAWING, 0, "", swError, swWarn)
....
Where infile is the complete path and file name of the drawing file that I want to open.

Thanks!
Janet
 
Replies continue below

Recommended for you

simple VB omission. You need the "Set" keyword to set an object.

Set swModel = swApp.OpenDoc6(infile, swDocDRAWING, 0, "", swError, swWarn)

[bat]On justice and on friendship, there is no price, but there are established credit limits.[bat]
 
Status
Not open for further replies.
Back
Top