FoxPro Programming
How to create a subclass of OleContainer control to hold the Excel ActiveX?
Gravatar is a globally recognized avatar based on your email address. How to create a subclass of OleContainer control to hold the Excel ActiveX?
  Alejandro A Sosa
  All
  Feb 18, 2019 @ 02:20pm

I would like to place an Excel spreadsheet on a VFP form. I believe this can be done by creating a subclass of VFP OleContainer control to hold the Excel ActiveX, but I don't know how to do it.

Does anyone has any experience doing this?

Thank you very much,

Alex

Gravatar is a globally recognized avatar based on your email address. re: How to create a subclass of OleContainer control to hold the Excel ActiveX?
  Rick Strahl
  Alejandro A Sosa
  Feb 18, 2019 @ 05:55pm

My advice: Don't.

I've done this with Word in the past and it's been nothing but pain. Inconsistent behavior, focus problems, random crashes. VFP's OleContainer support is terrible and I wouldn't go that route. If you have to use Excel use Automation to drive an external instance.

++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: How to create a subclass of OleContainer control to hold the Excel ActiveX?
  Alejandro A Sosa
  Rick Strahl
  Feb 19, 2019 @ 06:05am

Thanks for the advice. Will not embed Excel!

Perhaps you have a suggestion. What I'm trying to accomplish is to make this scheduling grid easier to use. For example I want make it posible for the user to select a number of cells and do a copy paste somewhere else.

Any ideas?

Thanks a lot.

Alex

Gravatar is a globally recognized avatar based on your email address. re: How to create a subclass of OleContainer control to hold the Excel ActiveX?
  Rick Strahl
  Alejandro A Sosa
  Feb 20, 2019 @ 03:40pm

Sorry, no suggestion short of some ActiveX component that provides Excel like functionality. I think there are a few (if they are still around) but they are pricey...

Alternately just automate Excel externally and keep track of when the document is saved or closed so you can switch back to FoxPro. In the end that's probably the best experience anyway since you have the whole Excel UI availalbe not just a specific subset.

+++ Rick ---

© 1996-2024