Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to automate Excel cell value update
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to automate Excel cell value update
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01048875
Message ID:
01048875
Vues:
68
Excel gurus: HELP ---

What commands will commit the values to an Excel spreadsheet?

The following code has no error - - - and no update in my master spreadsheet either
extra code removed (gLogMESS shows variables are correct as does dubug stepping)
   oExcel=CREATEOBJECT("Excel.Application")
   With oExcel
      .DisplayAlerts= .F.
         .WorkBooks.Open(ALLTRIM("C:\Daas\Absorb_2005new.xls"),0)
         .Sheets(ALLTRIM(" Buffing")).Select()
         DO PopulateExcelArray
      .Quit
   EndWith
   Release oExcel

Procedure PopulateExcelArray 
   DO ProvideDesc

PROCEDURE ProvideDesc
   DO UpdateSpreadsheet

PROCEDURE UpdateSpreadsheet
...
            IF !EMPTY(sA)
               cCell="A"+sRowID
               .Range(cCell).Select()
               .Range(cCell).Value= DATE(1990,01,01)&& CTOD(sA)
            ENDIF
* The s-CELL Values are all numeric at this point 
            IF sC > 0
               cCell="C"+sRowID
               .Range(cCell).Select()
               .Range(cCell).Value= sC
            ENDIF
            IF sH> 0
               cCell="H"+sRowID
               .Range(cCell).Select()
               .Range(cCell).Value= sH
            ENDIF
            IF sK> 0
               cCell="K"+sRowID
               .Range(cCell).Select()
               .Range(cCell).Value= sK
            ENDIF
            IF sT> 0
               cCell="T"+sRowID
               .Range(cCell).Select()
               .Range(cCell).Value= sT
            ENDIF
            IF sAB> 0
               cCell="AB"+sRowID
               .Range(cCell).Select()
               .Range(cCell).Value= sAB
            ENDIF
            IF sAD> 0
               cCell="AD"+sRowID
               .Range(cCell).Select()
               .Range(cCell).Value= sAD
            ENDIF
            IF sAE> 0
               cCell="AE"+sRowID
               .Range(cCell).Select()
               .Range(cCell).Value= sAE
            ENDIF
After all of that the spreadsheet is unchanged!
Edgar L. Bolton, B.S. B.B.A.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform