Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to group shapes in Excel by automation
Message
From
18/10/2005 05:18:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
How to group shapes in Excel by automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01059852
Message ID:
01059852
Views:
55
Hello everyone

I have a situation in which I want my program to group a set of shapes in Excel into one group. The shapes are textboxes. In order to do this, I started the macro recorder, built 2 textboxes,grouped them, switched to view the macro,and implement the code in my VFP program.
Essentially (left some unimportant propsettings out) this is the macro code:
    ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 51#, 48#, 60# _
        , 16.5).Select
    ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 51#, 64.5, 60# _
        , 16.5).Select
    ActiveSheet.Shapes.Range(Array("Text Box 2", "Text Box 1")).Select
    Selection.ShapeRange.Group.Select
It is easy enough to automate the first two statements and the fourth by VFP, but the third I cannot do, because of the ARRAY-call.
If I put the two strings "Text Box 2" and "Text Box 1" in a VFP array and give the array as an argument to Range() it doesn't work.

So how to do this in VFP?

Lennert
Next
Reply
Map
View

Click here to load this message in the networking platform