Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: surinder singh
  Where is surinder singh?
 mumbai
 India
 surinder singh
 To: M M
  Where is M M?
 Delhi
 India
 M M
 Tags
Subject: RE: Value Retention between VFP and Excel
Thread ID: 188275 Message ID: 188809 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Classes and Objects
Date: Tuesday, August 12, 2008 8:07:52 AM         
   


> Thanx for the solution. Your code is working and I am able to track the values of the variable. I think I need another help from u.
>
> As per the following code
> m.lnResult = filetostr("c:\myVBAoutput.txt")
>
> I am opening the file in drive c:, but it may so happen that this drive is not available in the user machine. Hence I need to open my file in the path where my VFP application is running. Say for example my VFP application is running as
>
> D:\MyVfpApplication
>
> Then I need to create my text file in this path only.
>
> Is there any means to know the working drives(Fixed Drives) available in my computer from the Excel Form.
>
> Cheers
> Madhu
>
>
> >
> > declare integer FindWindow in Win32API ;
> > 	string @cClassName, string @cWindowName
> > 
> > 
> > *set escape on
> > * on escape llExit = .F.
> > *llExit = .T.
> > lcCaption = oexcel.Caption 
> > do while llExit 
> > * if not llExit
> >  *  exit
> >  *endif
> >  if FindWindow(0, lcCaption) <= 0 && means window is closed
> >     m.lnResult = filetostr("c:\myVBAoutput.txt")
> >     wait window m.lnResult
> >     delete file "c:\myVBAoutput.txt"
> >     exit && exit the loop
> >  ENDIF 
> > enddo
> > 

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


it is quite simple.

From what path you opening/saving your excel file??
you can get that path by using CURDIR() function in VBA and in foxpro sys(0)+curdir()

VBA code
MyFile = CURDIR() + "\whateveryouwant1.txt"

in foxpro
fielTostr(sys(5) + CURDIR() + "\whateveryouwant1.txt")




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

ENTIRE THREAD

Value Retention between VFP and Excel Posted by M M @ 8/8/2008 2:05:03 PM
RE: Value Retention between VFP and Excel Posted by tushar @ 8/8/2008 2:12:22 PM
RE: Value Retention between VFP and Excel Posted by M M @ 8/11/2008 11:32:13 AM
RE: Value Retention between VFP and Excel Posted by surinder singh @ 8/11/2008 12:42:30 PM
RE: Value Retention between VFP and Excel Posted by M M @ 8/11/2008 3:46:54 PM
RE: Value Retention between VFP and Excel Posted by surinder singh @ 8/12/2008 6:51:02 AM
RE: Value Retention between VFP and Excel Posted by M M @ 8/12/2008 7:49:05 AM
RE: Value Retention between VFP and Excel Posted by surinder singh @ 8/12/2008 8:07:52 AM
RE: Value Retention between VFP and Excel Posted by M M @ 8/12/2008 8:43:37 AM
RE: Value Retention between VFP and Excel Posted by surinder singh @ 8/12/2008 8:53:56 AM
RE: Value Retention between VFP and Excel Posted by M M @ 8/12/2008 3:44:43 PM
RE: Value Retention between VFP and Excel Posted by M M @ 8/13/2008 4:58:17 PM
RE: Value Retention between VFP and Excel Posted by surinder singh @ 8/13/2008 6:22:14 PM
RE: Value Retention between VFP and Excel Posted by M M @ 8/18/2008 7:39:22 AM
RE: Value Retention between VFP and Excel Posted by tushar @ 8/18/2008 7:46:44 AM
RE: Value Retention between VFP and Excel Posted by M M @ 8/18/2008 1:50:07 PM
RE: Value Retention between VFP and Excel Posted by tushar @ 8/18/2008 3:09:58 PM
RE: Value Retention between VFP and Excel Posted by tushar @ 8/12/2008 9:28:09 AM