Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I convert VB macros to VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00550965
Message ID:
00550977
Vues:
12
"All the lines fail except the third.."

OK, if you have already included excel.h, the other issues present are the 0# that should be replaced by a plain 0, and checking if the .Selection evaluates to a valid Range object.


>Hi All
>
>Is there a set of rules anywhere that define how to convert xl (VB ) macro code to vfp - The following is a snippet of the macro generated by XL. I have already created my loXL object.
>
>with loXl
>
> .ActiveSheet.Shapes.AddLabel(msoTextOrientationHorizontal, 11.25, -2.25, 0# , 0#).Select
> .Selection.ShapeRange(1).TextFrame.AutoSize = msoTrue
> .Selection.Characters.Text = ;
> "MOAT TRUCK SALES" + Chr(10) + "LINK 56" + Chr(10) + "ZONE 3" + Chr(10) + "WEIGHBRIDGE ROAD, DEESIDE IND. PARK" + Chr(10) + "CH52LL"
> With loXl.Selection.Characters(Start:=1, Length:=17).Font
> .Name = "Arial"
> .FontStyle = "Bold"
> .Size = 12
> .Strikethrough = False
> .Superscript = False
> .Subscript = False
> .OutlineFont = False
> .Shadow = False
> .Underline = xlUnderlineStyleNone
> .ColorIndex = xlAutomatic
> EndWith
>
>endwith
>
>Virtually all the lines except the 3rd fail, unrecognised command. I have included the excel.h file and defined the two mso variables. I have also replace the underscores with ; and the & with the + sign.
>
>Any help would be appreciated
>Thanks
>Derek
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform