Question Locked

Can someone help

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

1 reply

This discussion is closed to new replies.