×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

OLE Error 2753

OLE Error 2753

OLE Error 2753

(OP)
I have a form with a button to attach a file into an OLE object. However, when the button is clicked it gives me the error "Run-time Error '2753':
A problem occurred while Microsoft Access was communicating with the OLE server. Close the OLE server and restart it outside of Microsoft Access. Then try the original operation again in Microsoft Access."

Microsoft suggests the problem is created by populating the bound OLE object in the BeforeUpdate event, but my code is in a button_click event. I've seen several posts related to this error, but never a solution.

Code follows:
Private Sub cmdAttach_Click()
'Open a common dialog box to select a file and attach it to the record
'as a link in a bound OLE field

Dim strPath As String

Me!CommonDialog.FileName = ""
Me!CommonDialog.ShowOpen
strPath = Me.CommonDialog.FileName

If strPath <> "" Then
    Me!OLEBound_Drawing.OLETypeAllowed = acOLEEmbedded
    Me!OLEBound_Drawing.SourceDoc = strPath
    ''''''''''''''''''''''''''''''''''''''''''''''''
    'throws an error on line below
    ''''''''''''''''''''''''''''''''''''''''''''''''
    Me!OLEBound_Drawing.Action = acOLECreateEmbed
End If

End Sub

I'd be grateful for any help.
Thanks,
dmh4ab

RE: OLE Error 2753

you are sending something fluucky to the compiler. Do and MSGBOX on strPath and you will see it.

rollie@bwsys.net

RE: OLE Error 2753

(OP)
Thanks Rolliee. I tried that and the path looks completely normal. (C:\Documents and Settings\e164735\My Documents\courses.xls). I also tried a path that has no spaces in the folder names. Same result.

dmh4ab

RE: OLE Error 2753

Okay!!!!

YOu may need a chr(34) in front of the string and a chr(34) behind.  The string you showed me here does not have quotes - thus the chr(34)


rollie@bwsys.net

RE: OLE Error 2753

(OP)
Thanks again Rolliee.
This gave me Run-time error 2101: "The setting you entered isn't valid for this property." It occurs when assigning the sourcdoc to the ole object. Seems Access automatically appends the " to the string as two showed up in the debug window.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close