Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Sugar House
  Where is Sugar House?
 Makati
 Philippines
 Sugar House
 Tags
Subject: RE: Importing from xlsx - part 2
Thread ID: 327800 Message ID: 331336 # Views: 34 # Ratings: 0
Version: Visual FoxPro 9 Category: Microsoft Office Automation
Date: Thursday, December 29, 2011 2:44:21 AM         
   


> >
> >
> > The name is dependent on the variable lcTemp where, being a temp file, I normally use sys(3) for the random names. So if you want to control the filename of the dbf, just change this:
> >
> >
lcTemp = Addbs(Getenv("TEMP"))+Sys(3)+".xls"
> > 

> >
> > Into this:
> >
> >
lcTemp = PUTFILE()  

> >
> > That is the 4th line (row) on the code snippets I showed there.
> >
> > http://sandstorm36.blogspot.com
> > http://weblogs.foxite.com/sandstorm36/default.aspx
>
>
> Thanks Jun :)
>
> Have you tried removing the saveas dialog box?
>
> Thanks again.


That is just to make it more flexible. However, if you already have a specific source for the target dbf name in your end like a textbox or if you base it on a field content in a table, you can do these instead of PUTFILE().

lcTemp = alltrim(thisform.text1.value)

or 

lcTemp = alltrim(mytable.myfield)


http://sandstorm36.blogspot.com
http://weblogs.foxite.com/sandstorm36/default.aspx

ENTIRE THREAD

Importing from xlsx - part 2 Posted by Jun Tangunan @ 11/22/2011 3:57:06 AM
RE: Importing from xlsx - part 2 Posted by Sugar House @ 11/24/2011 10:47:21 AM
RE: Importing from xlsx - part 2 Posted by Jun Tangunan @ 11/24/2011 10:54:06 PM
RE: Importing from xlsx - part 2 Posted by Sugar House @ 11/25/2011 12:20:55 PM
RE: Importing from xlsx - part 2 Posted by Sugar House @ 12/28/2011 12:42:21 PM
RE: Importing from xlsx - part 2 Posted by Jun Tangunan @ 12/28/2011 11:31:30 PM
RE: Importing from xlsx - part 2 Posted by Sugar House @ 12/29/2011 2:35:04 AM
RE: Importing from xlsx - part 2 Posted by Jun Tangunan @ 12/29/2011 2:44:21 AM
RE: Importing from xlsx - part 2 Posted by Sugar House @ 12/29/2011 2:50:17 AM