Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert to excel book
Message
 
 
À
12/09/2005 06:15:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01048102
Message ID:
01048788
Vues:
24
Mohammed,

I'm not going to write all of your code for you. I am happy to help you through the process of you writing it. I post you examples of how to do something it won't be literal code to be cut/pasted into your code. The .Sheets(2) code was to show you how to change sheets within the workbook. You will need to pick different sheets to get your data on different pages.

Go back and reread the message a few messages ago, you will need to separate the open/close of Excel from some sort of loop that will create your 3 datasets:

* initialize (open tables etc)
* start up excel
* loop
* create cursor with subseti
* write data to sheeti
* endloop
* close excel


>i try as under i see at sheet2 ,sometimes 16 records,next test 12 records next 10 records next 14 records...etc but i must get from my table 274 records exactly,
>and i get error message after save the excel book ole error code ox800ac472 unknown com stutus code, at
>
>loCol.Value = evaluate( laFields[i,1] )
>
So what is the value of that array element and what is the corresponding column value on that row of the cursor?

>i try to change loWorkbook to loWorkbookS for all code,same thing

loWorkBook and loWorkBooks are two different things hey can not be interchanged. The first is a reference to the Excel file you are populating, the second is the collection of all workbooks open in Excel.

>and i try via set step on just i get empty excel book with 4 sheets,

So your Excel is set to automatically create workbooks with 4 sheets. This might not always be the case when you deploy this app to the users. You can use the .Count to see how many pages are available and the .Add() method to create pages if you need them.

>and still i don't know how i can insert via select stament into sheet1,sheet2 and sheet3 via this code.
>
>anyway you try to bush me to do somthing , but i'm soory.

Mohammed, I'm trying to teach you how to explore this kind of problem for yourself so that you'll be able to solve them for yourself.

>
>CLOSE all
>USE AM2 IN 0
>Select * from am2 ;
>  where INLIST( val(char3), 100, 201, 202, 203 );
> and ( inList( upper(allt(telno)), "ADSL 1")) ;
>   into table am3 nofilter
>USE am3
If you want different subsets of data you can't use a static constant like "ADSL 1" in your code.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform