Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Problems with acOLECreateLink associated with Combo Boxes

Status
Not open for further replies.

Jables

Programmer
Aug 28, 2001
148
US
Here's what I'm trying to accomplish. When a user selects a value of a combo box, an AutoCAD drawing pops up (the drawing is, of course, dependent on which value the user selects in the combo box). So here's what I've done:

1. I insert an unbound object onto the form from the Toolbox. This wizard pops up and I have to choose "Creat New" and specify that it will be an AutoCAD drawing. I name the unbound object OLE1.

2. I associate the following code with the combo box's After_Update event:

Private Sub cbo1_AfterUpdate()
If Me.cbo1 = "Value 1" Then
Me.OLE1.Class = "AutoCAD.Drawing.14"
Me.OLE1.OLETypeAllowed = acOLELinked
Me.OLE1.SourceDoc = "T:\DWG\BLOCKS\drawing1.dwg"
Me.OLE1.Action = acOLECreateLink
Me.OLE1.SizeMode = acOLESizeZoom
Else If Me.cbo1 = "Value 2" Then
etc, etc,

So anyway, the program gets stuck as soon as it hits the OLE1.Action = acOLECreateLink line. I get a run-time error (error 2637, I think) and it says it's unable to perform the action specified. Also none of the properties of OLE1 ever change. That is, the Source Doc is still blank and the OLE Type is still "Embedded."

So what can I do here? Any help would be more than appreciated.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top