Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting excel macro to VFP
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00261234
Message ID:
00261279
Views:
27
John,

VFP does not recognize VB's named parameters. Try this
oExcel.ActiveChart.SetSourceData(Sheets("cheqsale").Range("AB4:AB8"),xlColumns)
If SetSourceData requires more than two parameters, you may have to insert commas to indicate any blank parameters. VFP will accept the blanks.

To check the Excel type definitions, you can use the Object Viewer in Excel's VBA editor or VFP's Class Browser. The file you are lookig for is in an Office sub-directory and named "Excel*.olb". The * is the version number for Excel. The syntax can change with newer versions.

You might want to download a VB to VFP parsing form that Kamel Patel is posting at http://www.flashcreative.com .

Tom Molloy


>
>Hi;
>
>I am trying to convert an excel macro for inserting a chart into vfp code and am having a problem with the two macro lines below (the second line starts with 'PlotBy'):
>
>ActiveChart.SetSourceData Source:=Sheets("cheqsale").Range("AB4:AB8"), _
> PlotBy:=xlColumns
>
>I have tried (and numerous other possibilities):
>
>

>I am using an excel.h file for constants.
>
>Any ideas would be appreciated.
>
>John
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform