Can someone help - TechRepublic
Question
November 14, 2006 at 04:57 AM
lumzy78

Can someone help

by lumzy78 . Updated 19 years, 8 months ago

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 discussion is locked

All Comments