Can someone help

By lumzy78 ·
i am trying to open a document from a server to OLE in my VB application via listed document in Combobox i write the code like this but its given me runtime error 31031 method 'createlink' of object '_OLE'failed

my code look like this

Private Sub CboFiles_Click()

If CboFiles.ListIndex <> -1 Then

If OLE1.AppIsRunning Then
Set objDoc = Nothing
OLE1.DoVerb vbOLEClosed

End If

'OLE1.CreateEmbed App.path & "\" & CboFiles.Text
OLE1.CreateLink App.path & "\" & CboFiles.Text
'OLE1.CreateLink File1.path & "" & File1.FileName
'Set objDoc = OLE1.object
OLE1.DataChanged = True
'OLE1.SizeMode = 2

OLE1.FileNumber = 1
OLE1.Action = 7
'OLE1.DoVerb vbOLEOpen
OLE1.Visible = True

End If

End Sub

can anyone mail best solution to this

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums