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!

*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.

Jobs

OLE XLS in a form, can't get it to work.

OLE XLS in a form, can't get it to work.

(OP)
Hi,

Why do I seem unable to load an XLS file in an OLE unbound object frame?

I have an object frame (linked) called xls

I am using this code...

CODE

With Me.xls
                .Enabled = True
                .Locked = False
                .Class = "Excel.Sheet"
                .SourceDoc = sDoc
                .OLETypeAllowed = acOLELinked
                .Action = acOLECreateLink
                .SizeMode = acOLESizeZoom
                .Visible = True
            End With 

But it just errors with

Quote:

Can't perform the operation specified in the Action property

Why can't I view a an XLS file?

1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: OLE XLS in a form, can't get it to work.

(OP)
This is weird I deleted the control and added it again, and this time this works?

CODE

Case Is = "xls", "xlsx"
            With Me.xls
                .Enabled = True
                .Locked = False
                .SourceDoc = sDoc
                .Visible = True
                .Action = acOLECreateEmbed
                .SizeMode = acOLESizeZoom
            End With 

It's because the control was not 'visible' when I tried to perform the action, if I make it visible, then perform the action it works. man that was doing my head in!

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: OLE XLS in a form, can't get it to work.

You changed the Action as well ...

RE: OLE XLS in a form, can't get it to work.

(OP)
I was messing with linked vs embeded, I was getting the error on both , it was because the control wasn't visible.

I so far got a half working GUI now.

I have had to put a webcontrol, OLE frame and a picture object and then flick between the objects depending on the document type.

One issue I have is if I use

.Action = acOLEActivate

The document is opening in the application first time round, but if I use the doubleclick on the OLE object, it opens it in the object?

So why is issuing the activate command opening the document in the office application and not the OLE control?

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: OLE XLS in a form, can't get it to work.

(OP)
I resolved the above but putting an onload event and a timer event.

It seems the object needs to have been rendered and the form visible otherwise it will open the doc in the office application instead of the OLE control

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

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!

Resources

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