Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VFP - Excel Automation

208 views
Skip to first unread message

Mahmud Abdulla

unread,
Nov 18, 2003, 10:19:47 AM11/18/03
to
What's the correct command for adding 3 rows at the beginning of a worksheet
opened by Excel Automation from VFP


Thanks in Advance
Mahmud Abdulla


Lee Mitchell

unread,
Nov 18, 2003, 11:43:37 AM11/18/03
to
Hi Mahmud:

I don't have the exact syntax, but I think you can use this code to get
started:

142193 HOWTO: Use OLE Automation to Add Data to Excel Sheet
http://support.microsoft.com/?id=142193

You might also want to look at this article to familiarize yourself with
the Office object model:

222101 HOWTO: Find and Use Office Object Model Documentation
http://support.microsoft.com/?id=222101

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retires Sept. 30th, 2003

Frédéric Steczycki

unread,
Nov 18, 2003, 1:23:34 PM11/18/03
to
assuming that your excel application object is oxls and that this oxls as an
active worksheet

with oXls
.Columns("A:C").Select
.Selection.Insert()
endwith

Fred

Pour mémoire, tu nous as écrit :

Neil Waterworth

unread,
Nov 18, 2003, 9:11:56 PM11/18/03
to
> assuming that your excel application object is oxls and that this oxls as
an
> active worksheet
>
> with oXls
> .Columns("A:C").Select
> .Selection.Insert()
> endwith
>

For rows instead of columns, use
.Rows("1:3").Select

Mahmud Abdulla

unread,
Nov 19, 2003, 12:53:27 AM11/19/03
to
It worked :-) thanks to all.

Regards
Mahmud Abdulla


"Neil Waterworth" <nospam-or-...@lineone.net> wrote in message
news:%23RG2DKk...@TK2MSFTNGP09.phx.gbl...

Mahmud Abdulla

unread,
Nov 19, 2003, 1:15:49 AM11/19/03
to
Hi,

How do I release the selection after I am done adding the rows and inserting
the Titles etc

Regards
Mahmud Abdulla

"Neil Waterworth" <nospam-or-...@lineone.net> wrote in message
news:%23RG2DKk...@TK2MSFTNGP09.phx.gbl...

Frédéric Steczycki

unread,
Nov 19, 2003, 2:49:58 AM11/19/03
to
Bonjour Mahmud


by selecting something else
oXls.Range("A1").Select

Fred
PS:dunno why but i thought columns instead of rows <s>

Pour mémoire, tu nous as écrit :

> Hi,


--
- Fred
FE AVP&Cie
MS VFP MVP
email : http://cerbermail.com/?jWyjWqURpf

0 new messages