Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Automation Question: Insert a row
Message
 
 
À
08/04/2007 16:42:32
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01213304
Message ID:
01365013
Vues:
23
Hi Chaim,

Very nice picture of you.

All the best,

Naomi

>I am trying to insert a row into a spreadsheet. I am most of the way there but need some help...
>
>I have an object references to Excel, the workbook, and the selected worksheet:
> loExcel
> loWorkbook
> loWorkSheet
>
>
>I want to insert some rows after a given row, let's say row 8, so I issue:
> loWorksheet.Range("A8").Select
>
>Then I insert a row:
> loExcel.Selection.EntireRow.Insert()
>
> The above line of code works, but it inserts a row using the characteristics of the previous row. I want to insert a row using the characteristics of the following row.
> Using the macro recorder, I found that Excel inserts using the characteristics of the following row like this:
>
>Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromRightOrBelow
>
>But I cannot figure out how to convert this Excel syntax to a syntax that VFP will accept.
>
>
>
>Also, is there a way to insert multiple lines at one time rather than one row at a time? I will know in advance how many rows I want to insert and it would be nice to be able to tell Excel: "please insert 500 rows" rather than ask Excel 500 times to insert 1 row.
>
>Many thanks in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform