Question

Locked

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
OLE1.Close
OLE1.Delete

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 lumzy78@yahoo.co.uk
thanks

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Networks Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums