Avatar of esak2000
esak2000
 asked on

embed a spreadsheet on foxpro form

What's the best way to embed an ActiveX spreadsheet on to a FoxPro form?
I currently have office 2007 on my computer, and the ActiveX spreadsheet 11.0 is not working - I get a COM error when I try to insert it on to my form.

My goal is to be able to cut from excel and paste on to the FoxPro form, and then programatically work with the data.
FoxPro

Avatar of undefined
Last Comment
pandu_kusumawardhany

8/22/2022 - Mon
mikegagnon

What is the exact error. I cannot reproduce that.
Cyril Joudieh

One of the solutions I use it copy from Excel itself and paste it on a grid in FoxPro.

I detect the Ctrl+V and parse _CLIPTEXT and fill the rows and the fields in the awaiting cursor accordingly and refresh the grid.

Sheets should also work if you put the OLE Object in the Form.

We need to know the error you are receiving to help you further.
esak2000

ASKER
Hi CaptainCyril,

Thank you for your pasting to the grid suggestion. I prefer to use an OLE spreadsheet object.

The message that I'm receiving when I try to insert Microsoft Office Spreadsheet 11.0 OLE Object is the following:

OLE Error code 0x80040202: Unknown COM status code.

I wonder if it has to do with my using Office 2007

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Cyril Joudieh

I was able to slap an Excel Sheet using OLE Control File Browse on a FoxPro Form and then ran the form and edited that sheet. I got the whole Ribbon from Excel 2007 inside and it's working fine.

I guess something is wrong with your computer.

Do you have two versions of Office installed? Did you upgrade from a previous version?
esak2000

ASKER
I upgraded from Office 2003
Pavel Celba

What is your OS, VFP and DLL file version?

It is working fine for VFP 9.00.0000.7423 and OWC11.DLL 12.0.6502.5000 on Vista 32 bit PC.

Above DLL version is available here: http://support.microsoft.com/kb/947318

Many different versions of this control exist - here is also one newer than mine: http://support.microsoft.com/kb/968377

Most of the COM error are comming from invalid registration. You may try to unregister and register the DLL again.

You could also check access rights for the DLL and its folder (obviously C:\Program Files\Common Files\microsoft shared\Web Components\11)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Cyril Joudieh

I even have it working on the same config as Pavel's with 64-bit Vista Ultimate.

Have you tried it with administrator rights?
ASKER CERTIFIED SOLUTION
Pavel Celba

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Cyril Joudieh

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Olaf Doschke

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Pavel Celba

These Web components were not developed together with Office.

Thus  OWC11.DLL is stored in C:\Program Files\Common Files\microsoft shared\Web Components\11 folder but its version is 12.xx.....  OWC12.DLL also exists somewhere... but not on my computer.

Office 2003 was never installed on my PC but the OWC11.DLL is there. I've installed Office 2007 only. And probably the Web components 2003 as a standalone product.

And Microsoft Office 2003 Web Components has Service Pack 1 (SP1) for the 2007 Microsoft Office System:
http://www.microsoft.com/downloads/en/details.aspx?familyid=C815DFFA-D5F3-4B71-BF46-13721BD44682&displaylang=en

This blog is also interesting: http://aspnetresources.com/blog/where_are_office_2007_web_components
pandu_kusumawardhany

good question and good comment.

a few hours ago, i've had the problem when opened Microsoft Spreadsheet in My Fox Pro.

this article very useful
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy