Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: tushar
  Where is tushar?
 Panaji
 India
 tushar
 To: Elijah Kihuga
  Where is Elijah Kihuga?
 Nairobi
 Kenya
 Elijah Kihuga
 Tags
Subject: RE: Save, SaveAs in Excel
Thread ID: 232066 Message ID: 232070 # Views: 26 # Ratings: 0
Version: Visual FoxPro 6 Category: Microsoft Office Automation
Date: Friday, June 19, 2009 12:28:23 PM         
   


> goingtothetop
>
> I am using the code below - different cursors - to copy data from Foxpro to an excel sheet- different columns.
>
> Problem is... I have to click on Save changes... every time I paste and close the workbook.
>
> If I say oExcelObject...Save or SaveAs... it requires overwriting of the main document... which is not required.
>
> Is there a better way forward ?
>
> SELECT Y1Lot
> _VFP.DataToClip()
>
> WITH oExcelObject.Worksheets("Valuations")
> oExcelObject.ActiveSheet.range("A5").select && Paste the Data
> oExcelObject.ActiveSheet.Paste() && Paste the Data
> oExcelWorkbook.close
> ENDWITH
>
> SELECT Y1Valu
> _VFP.DataToClip()
>
> oExcelWorkbook = oExcelObject.Application.Workbooks.Open(cSheet)
>
> WITH oExcelObject.Worksheets("Valuations")
> oExcelObject.ActiveSheet.range("B5").select && Paste the Data
> oExcelObject.ActiveSheet.Paste() && Paste the Data
> oExcelWorkbook.close
> ENDWITH

Why do you want to close and then reopen the workbook. keep the workbook open and save it at the end.

Regards
Tushar



COMPLETE THREAD
Save, SaveAs in Excel Posted by Elijah Kihuga @ 6/19/2009 12:15:02 PM
RE: Save, SaveAs in Excel Posted by tushar @ 6/19/2009 12:28:23 PM
RE: Save, SaveAs in Excel Posted by Anders Altberg @ 6/19/2009 12:32:39 PM
RE: Save, SaveAs in Excel Posted by Tamar Granor @ 6/19/2009 10:44:20 PM
RE: Save, SaveAs in Excel Posted by Elijah Kihuga @ 6/20/2009 2:03:10 PM