I input the code:
Private Sub Command1_Click()
Dim oAssyDoc As Inventor.AssemblyDocument
Dim InvApp As Inventor.Application
Set InvApp = GetObject(, "Inventor.Application")
InvApp.Open "J:\ASSY.iam", True
Set oAssyDoc = InvApp.ActiveDocument
oAssyDoc.Update
oAssyDoc.Save
oAssyDoc.Close
End Sub
but now I get the error on line 3
------
Run-time error '429'
ActiveX component can't create object
----------
Am I missing Project References?
I am using:
Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation
Autodesk Inventor Object Library
"Rob W."
wrote in message
news:444180BBDD589C153EC7FEC3BF02D106@in.WebX.maYIadrTaRb...
> The problem is using the GetObject function to open the document. Replace
> the call to GetObject with something like....
>
> Dim myApp As Inventor.Application
>
> Set myApp = GetObject(, "Inventor.Application")
> myApp.Open "yourfile.iam", True
> Set oAssyDoc = myApp.ActiveDocument
>
> No error checking so be careful....
> rw
>
> "It's not the modeler mate, It's how you use it"
>
> "A.Fickes" wrote in message
> news:D8421E11EF14BF48430285E6F5F736BF@in.WebX.maYIadrTaRb...
> > I created a master excel spreadsheet to get around the i-assembly issue,
> > fake parts and excel driven/linked BOMs. (Thanks for the nice tuts
Sean),
> > but now I have a problem working with the Inventor API.
> >
> > My VB6 program updates a few spreadsheets, but now I need to update the
> > master assembly before opening the drawings for printing.
> >
> >
> > I've tried a few ways to open and update an assembly, but to no avail.
> >
> > Private Sub Command1_Click()
> > Dim oAssyDoc As Inventor.AssemblyDocument
> > Set oAssyDoc = GetObject("J:\...\...\...\...\...\...\...\ASSY.iam")
> > oAssyDoc.Update
> > oAssyDoc.Save
> > oAssyDoc.Close
> > End Sub
> >
> > Error: Run-time Error '7' - Out of Memory on the Second Line
> >
> >
> > I hate to ask for debug help...but what am I missing?
> > The file I'm opening is but 250k, but it has links to many parts that
need
> > to update from the excel change.
> >
> > Should there also be some reference to a project, or can I only use the
> > current project that Inventor was closed with?
> >
> > Thanks,
> >
> > -af
> >
> >
>
>