Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Activesheet in Excel
Message
 
À
25/09/2002 09:13:07
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00703696
Message ID:
00704207
Vues:
24
>Thanks Alexander! One more question. Using the example that you sent in my original message:
>
>For Each ws in oApp.Worksheets
> ws.Activate()
>EndFor
>
>How do I incorporate that into the following code? Just wanted this for future reference. I'm new to automation and I'm confused as I'm not sure where the reference of the object "ws." fits in below.
>
>oExcel = createobject('Excel.Application')
> oExcel.Workbooks.Open(getFile('xls'))
>oexcel.ActiveWorkbook.ActiveSheet.Range("A1:H120").Copy
>lcData = _cliptext
>oexcel.quit

ws is a temporary variable used in iteration through the elements of Worksheets collection. Each time it represents a next Worksheet object:

For Each ws in oExcel.Worksheets
ws.Activate()
EndFor
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform