Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications

Post new topic   Reply to topic
run time error 91
View previous topic :: View next topic  
Author Message
angiepeters
Newbie


Joined: 11 May 2005
Posts: 2

PostPosted: May 11th, 2005 09:39 AM    Post subject: run time error 91 Reply with quote

I am trying to write code that will set parameters in Catia (a 3d modelling program) to values I have in excel. when I run it I get Run-time error 91 'Object variable or with block variable not set' and highlites the line 'set windowasm....'
I am new at this stuff and can't figure out what I am doing wrong.
Hope someone can help me!

Dim CATDocs As Documents
Dim specsAndGeomWindow1 As Window
Dim base As Document
Dim jaw As Document
Dim windowasm As ProductDocument
Dim windowprod As Product
Dim parameterslist As Parameters
Dim viewer3D1 As Viewer

Private Sub CommandButton1_Click()

Dim catia As Object
On Error Resume Next
Set catia = GetObject(, "CATIA.Application")
If Err.Number = 425 Then
Set catia = CreateObject("CATIA.Application")
Err.Clear
End If
On Error GoTo 0

osmwidth = Sheet1.Cells(12, 4).Value
osmheight = Sheet1.Cells(14, 4).Value
osmradius = Sheet1.Cells(20, 4).Value

Set windowasm = catia.Documents.Open("C:\Documents and Settings\Administrator\My Documents\skeleton\CTC3\Product1.CATProduct") Confused

Set windowprod = windowasm.Product

Set parameterList = windowprod.Parameters

Set OverallWidth = parameterList.Item("Overall Width")
OverallWidth.Value = osmwidth

Set OverallHeight = parameterList.Item("Overall Height")
OverallHeight.Value = osmheight

Set RadLeg = parameterList.Item("Camber (leg/rad)")
RadLeg.Value = osmradius


windowprod.Update
Set SpecsAndGeomWindow = catia.ActiveWindow
Set viewer3D1 = SpecsAndGeomWindow.ActiveViewer
viewer3D1.Reframe

End Sub
Back to top
View user's profile Send private message
angiepeters
Newbie


Joined: 11 May 2005
Posts: 2

PostPosted: May 13th, 2005 01:30 PM    Post subject: Reply with quote

Nevermind.
It turns out, it was a registration problem with the 3d modelling program.
Once that issue was resolved, it ran fine.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic