Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bernard Bout
  Where is Bernard Bout?
 Brisbane
 Australia
 Bernard Bout
 To: surinder singh
  Where is surinder singh?
 mumbai
 India
 surinder singh
 Tags
Subject: RE: Open Excel file in VFP form
Thread ID: 188308 Message ID: 189379 # Views: 4 # Ratings: 0
Version: Visual FoxPro 9 Category: Microsoft Office Automation
Date: Thursday, August 14, 2008 4:48:50 PM         
   


> >
> > Will this idea help any? It actually "embeds" excel into your form so anything you can do with Excel you can do here.
> >
> > Message ID: 129391
> >
> > Bernard
> >
> > ** If you see someone without a smile, give em one of yours :) **
> > My Blog 8-)
>
> hi Bernard,
> it is really good.
> thanks for reference.
>
> I want to know if it is possible to show excel only inside the shape area
> mean to say if I resize the excel then it can be resized in whole form
> because of this other controls are going behind it.
>
> is it possible to restrict users to resize excel only in the defined area (of shape)?
>
> I have tried by using event handling of excel but could not find where to write the code in
> PROCEDURE AppEvents_WindowResize(Wb AS VARIANT, Wn AS VARIANT) AS VOID
>
> but could not succeed.
>
> -----------------------------------------------------------------------------------------------
> Regards
> Surinder Singh
> Email: sur200@indiatimes.com
> Check my blog for details: http://weblogs.foxite.com/sur200
> ----------------------------------------------------------------------------------------
> *If you understand what you're doing, then you're not learning anything.

Surinder

You have a few choices. You can use BindEvents to trap the resize of Excel and stop it there itself.

A better choice is to do this:

Have a form - Mainform

Have another form - childform.

From Mainform, run childform with NOSHOW. Then issue SHOW WINDOW childform in WINDOW Mainform.

Now childform is shown within the main form. Childform must be a VFP form with no title bar and so no way of moving it.

Now get its hWnd and use that instead.

If all this is too much, then just download the attached zip and run the form. Then click the button to embed Notepad. You can also checkout the API SetWindowPos as that has a number of options of sizing windows etc. With Excel the code is very similar. Check out how I do it in the code of the button click.

https://www.foxite.com/uploads/14daff39-6007-48b2-bc8c-4487e3478315.zip

Also if using Excel, you can obtain an object instance to the embedded Excel and do things with it the usual way.

Bernard

** If you see someone without a smile, give em one of yours :) **
My Blog 8-)

ENTIRE THREAD

Open Excel file in VFP form Posted by Nishant Gupta @ 8/8/2008 6:17:18 PM
RE: Open Excel file in VFP form Posted by Anders Altberg @ 8/8/2008 6:28:59 PM
RE: Open Excel file in VFP form Posted by Samir Ibrahim @ 8/9/2008 11:47:27 AM
RE: Open Excel file in VFP form Posted by Anders Altberg @ 8/9/2008 1:33:33 PM
RE: Open Excel file in VFP form Posted by Yousfi Benameur @ 8/8/2008 7:07:14 PM
RE: Open Excel file in VFP form Posted by Nishant Gupta @ 8/9/2008 11:45:47 AM
RE: Open Excel file in VFP form Posted by Anil Sharma @ 8/8/2008 7:30:02 PM
RE: Open Excel file in VFP form Posted by Samir Ibrahim @ 8/9/2008 11:42:40 AM
RE: Open Excel file in VFP form Posted by Bernard Bout @ 8/14/2008 5:34:31 AM
RE: Open Excel file in VFP form Posted by surinder singh @ 8/14/2008 8:12:56 AM
RE: Open Excel file in VFP form Posted by Bernard Bout @ 8/14/2008 4:48:50 PM
RE: Open Excel file in VFP form Posted by Nishant Gupta @ 8/15/2008 9:23:26 AM
RE: Open Excel file in VFP form Posted by Bernard Bout @ 8/15/2008 11:28:05 AM
RE: Open Excel file in VFP form Posted by Nishant Gupta @ 8/15/2008 8:05:01 PM
RE: Open Excel file in VFP form Posted by Samir Ibrahim @ 8/14/2008 10:30:11 AM
RE: Open Excel file in VFP form Posted by Nishant Gupta @ 8/14/2008 2:57:07 PM
RE: Open Excel file in VFP form Posted by Samir Ibrahim @ 8/16/2008 3:34:01 PM
RE: Open Excel file in VFP form Posted by Yousfi Benameur @ 8/14/2008 4:07:07 PM
RE: Open Excel file in VFP form Posted by Bernard Bout @ 8/15/2008 3:14:36 AM
RE: Open Excel file in VFP form Posted by Yousfi Benameur @ 8/20/2008 12:52:43 AM
RE: Open Excel file in VFP form Posted by Bernard Bout @ 8/20/2008 8:20:47 AM
RE: Open Excel file in VFP form Posted by Cetin Basoz @ 8/15/2008 11:36:39 AM
RE: Open Excel file in VFP form Posted by Yousfi Benameur @ 8/15/2008 6:02:59 PM
RE: Open Excel file in VFP form Posted by Cetin Basoz @ 8/16/2008 4:57:26 PM
RE: Open Excel file in VFP form Posted by Nishant Gupta @ 8/15/2008 8:13:35 PM
RE: Open Excel file in VFP form Posted by Yousfi Benameur @ 8/15/2008 6:58:44 PM
RE: Open Excel file in VFP form Posted by Nishant Gupta @ 8/15/2008 8:15:31 PM
RE: Open Excel file in VFP form Posted by Tarik AlKathiri @ 8/16/2008 3:00:25 PM
RE: Open Excel file in VFP form Posted by Yousfi Benameur @ 8/16/2008 3:59:21 PM
RE: Open Excel file in VFP form Posted by Tarik AlKathiri @ 8/18/2008 12:25:50 PM