Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EXCEL with MULTIPLE WORKSHEETS
Message
 
 
To
03/10/2005 12:05:02
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, United States
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01055537
Message ID:
01055542
Views:
12
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform