Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: JaiPrakash Bhandari
  Where is JaiPrakash Bhandari?
 Hyderabad
 India
 JaiPrakash Bhandari
 Tags
Subject: RE: Save As 'Txt to Xls'
Thread ID: 228461 Message ID: 228490 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Active X Controls & OLE Automation
Date: Tuesday, May 19, 2009 10:47:47 AM         
   


> Hello!
> I have an TAB separated text file, and I want to Save it as .Xls by not opening the file.
> Is it possible programmatically through VFP ?
> This is required as I want to get the values on the Excel sheet.
>
> Regards
> Bhandari

LOCAL oExcel AS Excel.APPLICATION
LOCAL oBook AS Excel.Workbook
oExcel = CREATEOBJECT("Excel.Application")
oExcel.displayAlerts=.f.
oBook = oExcel.Workbooks.open(getfile('txt'))     
*oExcel.visible=.t.  &&if you want
oExcel.save("c:\myExcel.xls")
oBook.close
oExcel.quit


Dont rate please.its only for the pleasure to help.Give me only a feed back.
Yousfi Benameur

ENTIRE THREAD

Save As 'Txt to Xls' Posted by JaiPrakash Bhandari @ 5/19/2009 8:08:09 AM
RE: Save As 'Txt to Xls' Posted by Stefan Wuebbe @ 5/19/2009 10:30:20 AM
RE: Save As 'Txt to Xls' Posted by Yousfi Benameur @ 5/19/2009 10:47:47 AM
RE: Save As 'Txt to Xls' Posted by Cetin Basoz @ 5/19/2009 2:43:09 PM