Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EXCEL with MULTIPLE WORKSHEETS
Message
 
 
À
03/10/2005 12:05:02
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Divers
Thread ID:
01055537
Message ID:
01055542
Vues:
15
>Hello!
>
>Does someone can guide me through extracting data from an Execl spreadsheet with multiple work sheets. For example I get a spreadsheets called Orders.xls. I has three
>work sheets Customers, Order Header & Order Line Items.
>
>Thanks In Advance
>
>Raza Malik
>razam@u-a-s.com

recently used code ... VFP 9
   oExcel=CREATEOBJECT("Excel.Application")
   With oExcel
      .DisplayAlerts= .F.
      Nothing=0
         .WorkBooks.Open(cWorkAreaDir+"Excel_"+cFHJulian+".Xls",0)
            .Sheets("AFO").Select()
...
               IF .range("C"+ALLTRIM(str(Edcnt))).Value => 0
                  cSpreadsheetdate= DTOC(.range("A"+ALLTRIM(str(Edcnt))).Value)
                  nSpreadsheetrow= Edcnt
...
               ENDIF 
...
         .Sheets(ALLTRIM(Charttabs.Tab)).Select()
         gLogMESS= " "+ ALLTRIM(ChartTabs.Tab)
         Do WriteLog
...
      .Save
      .Quit
   EndWith
   Release oExcel

and

PROCEDURE ProvideDesc
...
   .Range("C1").Select()
   cDescription= ALLTRIM(IIF(ISNULL(.Range("C1").Value)," ",AllTrim(TRANSFORM(.Range("C1").Value))))+" "
   .Range("C2").Select()
   cDescription= cDescription+ ALLTRIM(IIF(ISNULL(.Range("C2").Value)," ",AllTrim(TRANSFORM(.Range("C2").Value))))+" "
   .Range("C3").Select()
   cDescription= cDescription+ ALLTRIM(IIF(ISNULL(.Range("C3").Value)," ",AllTrim(TRANSFORM(.Range("C3").Value))))
You really don't have to select the cell to retrieve from it.

See if that's gets you started
Edgar L. Bolton, B.S. B.B.A.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform