Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamically update an Excel file
Message
De
25/04/2001 13:29:01
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
25/04/2001 13:21:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00499704
Message ID:
00499719
Vues:
24
>>What do you want to do ? More info pls.
>>Basically :
>
>>oExcel=createobject('Excel.Application')
>>with oExcel
>> .Workbooks.Open(cXLSFileName)
>> *...
>>endwith
>>Cetin
>
>I need to opena an Excel file (which you code explains), then update certain columns with data. Then save and close the file.
>
>Thanks, Chris

Chris,
Updating columnwise, rowwise, ranges or particular cells differ (you could update cell by cell but it's the slowest way I know of). Anyway assuming you would update col12, rows5-10 :
With oExcel
  .WorkBooks.Open(lcXLSFile) && Open saved
  With .ActiveWorkBook
    With .ActiveSheet
      .Cells(5, 12).Value = lnValue1
      .Cells(6, 12).Value = lnValue2
      .Cells(7, 12).Value = lnValue3
      .Cells(8, 12).Value = lnValue4
      .Cells(9, 12).Value = lnValue5
      .Cells(10, 12).Value = lnValue6
    Endwith
  Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform