General information
Category:
COM/DCOM and OLE Automation
"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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only