Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel automation 101
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Excel automation 101
Divers
Thread ID:
00543842
Message ID:
00543842
Vues:
53
I'm using VFP 6.0 as the interface, and Excel as the data storage tool. My questions are:
1) are certain VBA methods not available to FoxPro?
2) how would I go about adding a new record to an existing Excel sheet?

I've created a form-based object createobject'ed in the Form Load called oEx
(for 'Excel object'). In the UDF MakeLists() I have the following
statements:
nClientNum = .oEx.Sheets("Clients").Range("A3").Value
What's so cool to this newbie to automation is that this actually works.

Well, it seems not all VBA commands are going to work, however (please
correct me if I'm wrong!), for instance, in the Save Button Click() method,
I have the following statement:

cSheet = SUBSTR(CMONTH(THISFORM.TxtDate.Value),1,3)
WITH THISFORM.oEx
* Pick the appropriate worksheet
.Sheets(cSheet).Select && works

* Insert a row
.Rows("5:5").Select && works
.Sheets.Selection.Insert Shift:=xlDown && generates a compile error
ENDWITH

Thanks for taking the time to ponder my situation and possibly offering a
solution. I'm happy to study a FAQ - this seems to be the kind of question *someone* must have asked before, but I've found nothing so far in my searches of UT FAQs ...

Regards,
Robin
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform