Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamically update an Excel file
Message
From
25/04/2001 13:29:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
25/04/2001 13:21:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00499704
Message ID:
00499719
Views:
28
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform