Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Automation Help
Message
De
07/04/2004 13:09:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/04/2004 13:05:18
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00891618
Message ID:
00892989
Vues:
42
>>That was excellent and worked as advertised, but when I try to apply the same technique on another spreadsheet, I get the error: "Unable to get the Insert property of the Range class"
>>
>>The working excel macro is:
>>
>>    Range("B3:C31").Select
>>    Selection.Copy
>>    Selection.Insert Shift:=xlToRight
>>
>>
>>And my attempted VFP code to do the same thing is:
>>
>>oExcel.WorkBooks.Open(THISFORM.cdatapath+[YugiohTemplate.xls])
>>oRecapSheet = oExcel.Activesheet
>>#Define xlShiftRight -4152
>>WITH oRecapSheet
>>    FOR i = 3 TO nColumnCount STEP 2
>>	.Range("B3:C31").Copy
>>	.Range("B3:C31").Insert(xlShiftRight)
>>    NEXT
>>ENDWITH
>>
>>
>>Can you tell me what I'm missing?
>>
>>Much thanks in advance!
>
>>#Define xlShiftRight -4152
>
>Is it true ?
>Try with -4161
>Cetin

If that was it :
When you record a macro (while you're there in editor:) :
-Press F2
-Enter constant name (ie: xlToRight) and press enter
You'd see values listed in decimal and hex(signed).

If you're using VFP7 and later :
-Open a new code window
-Invoke Excel type library using object browser
-Drag&drop constants node on to code window
-Save as xlconstants.h
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform