Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel automation 101
Message
From
14/08/2001 20:50:34
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Excel automation 101
Miscellaneous
Thread ID:
00543842
Message ID:
00543842
Views:
48
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
Next
Reply
Map
View

Click here to load this message in the networking platform