Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Opening a part with Excel vba on the network

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
199 Views, 2 Replies

Opening a part with Excel vba on the network

My VB/VBA skills have gotten a little rusty in the last couple of months but why won't this code open the file from the network: Private Sub cmdUpdatePart_Click()On Error Resume Next
Set oApp = GetObject(, "Inventor.Application")
If Err Then
MsgBox "Inventor needs to be open first."
Exit Sub
End IfstrFile = "\\NASWIIFS001\ASI_COMMON\VIPER FILES\INVENTOR FILES\PUCHASED COMPONENTS\INTER-LAKES\B150.ipt"
On Error GoTo errHandler
Set oPartDoc = oApp.Documents.Open(strFile, True)
Any suggestions?

Mike
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Hi Mike

I stripped it down to this in VBA and it works for me... does that help any?

Private Sub cmdUpdatePart()

On Error Resume Next

Dim strFile As String
Dim oPartDoc As PartDocument

strFile = "\\Svprog\j\dwg\9947\I\994702.ipt"

Set oPartDoc = ThisApplication.Documents.Open(strFile, True)

End Sub


--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"MDB" wrote in message news:f175d80.-1@WebX.maYIadrTaRb...
> My VB/VBA skills have gotten a little rusty in the last couple of months but why won't
this code open the file from the network: Private Sub cmdUpdatePart_Click()On Error Resume
Next
> Set oApp = GetObject(, "Inventor.Application")
> If Err Then
> MsgBox "Inventor needs to be open first."
> Exit Sub
> End IfstrFile = "\\NASWIIFS001\ASI_COMMON\VIPER FILES\INVENTOR FILES\PUCHASED
COMPONENTS\INTER-LAKES\B150.ipt"
> On Error GoTo errHandler
> Set oPartDoc = oApp.Documents.Open(strFile, True)
> Any suggestions?
> Mike
>
Message 3 of 3
Anonymous
in reply to: Anonymous

Spaces? We don't need no stinking spaces.

Its amazing what a space will do to string.....

Thanks Kent for verifying at least that I could open with UNC anyways. I was getting down to my last handfull of hair.

Mike

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report