Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Riccardo Pimpini
  Where is Riccardo Pimpini?
 Firenze
 Italy
 Riccardo Pimpini
 Tags
Subject: RE: call Excel from VFP
Thread ID: 248784 Message ID: 248795 # Views: 3 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Microsoft Office Automation
Date: Wednesday, December 23, 2009 12:31:54 PM         
   


> >
> > Try:
> >
> >
loExcel = CREATEOBJECT('excel.application')
> > loExcel.WorkBooks.Open('cartel.xls')
> > loExcel.VISIBLE = .T.
> > 

> > Regards,
> > akram
>
> Thanks,
>
> Ok, i got the point that to pass a parameter to the object o have to use object proprieties...
>
> the question now is that i still can't run the application...
>
> there is something in the line
>
>
loExcel = CREATEOBJECT('excel.application')

>
> that is missing...
>
> i tryed
>
>
loExcel = NEWOBJECT('excel.application')

>
> instead but with no better results...
>
> Using Windows Task Manager I noticed that sometimes
CREATEOBJECT 
opens an excel thread but it is closed after a second...
> I suppose that there is someting that generates an error and windows autonomously close the thread....
>
> I also tryed the command
>
>
SET OLEOBJECT ON

>
> to be sure that the createobject function can work properly but no significative changes are shown...
>
> What are the Proprieties of an excel.application object?
>
> Let me know.
>
> Thanks.
>
> Shinedom - Shineing is free....

If you do
loExcel=CreateObject("Excel.Application") 
in the Command window loExcel will become a public variable and you'll get Excel IntelliSense when you continue the next line with
loExcel.
If you're in a program editing window you'll get Intellisense working by starting with the command:
LOCAL loExcel AS Excel.Application
loExcel=CreateObject("Excel.Application")
loExcel.

-Anders

ENTIRE THREAD

call Excel from VFP Posted by Riccardo Pimpini @ 12/23/2009 11:09:30 AM
RE: call Excel from VFP Posted by ho me @ 12/23/2009 11:15:39 AM
RE: call Excel from VFP Posted by Riccardo Pimpini @ 12/23/2009 11:31:44 AM
RE: call Excel from VFP Posted by M. Akram Bhatti @ 12/23/2009 11:36:59 AM
RE: call Excel from VFP Posted by Riccardo Pimpini @ 12/23/2009 12:06:32 PM
RE: call Excel from VFP Posted by M. Akram Bhatti @ 12/23/2009 12:11:58 PM
RE: call Excel from VFP Posted by Anders Altberg @ 12/23/2009 12:31:54 PM
RE: call Excel from VFP Posted by Stefan Wuebbe @ 12/23/2009 4:12:52 PM
RE: call Excel from VFP Posted by M. Akram Bhatti @ 12/23/2009 12:00:10 PM
RE: call Excel from VFP Posted by Stefan Wuebbe @ 12/23/2009 12:05:21 PM
RE: call Excel from VFP Posted by Riccardo Pimpini @ 12/23/2009 12:18:24 PM
RE: call Excel from VFP Posted by tushar @ 12/23/2009 1:11:17 PM
RE: call Excel from VFP Posted by Riccardo Pimpini @ 12/23/2009 2:08:23 PM
RE: call Excel from VFP Posted by tushar @ 12/23/2009 3:27:06 PM
RE: call Excel from VFP Posted by Stefan Wuebbe @ 12/23/2009 4:18:01 PM
RE: call Excel from VFP Posted by Stefan Wuebbe @ 12/23/2009 4:43:31 PM
RE: call Excel from VFP Posted by Cetin Basoz @ 12/23/2009 3:40:39 PM