Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with automating spreadsheet containing VBA code
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00736099
Message ID:
00903432
Views:
23
Great. Thanks so much!
Steve Elster

oExcel = GETOBJECT(,'excel.application')
ObjExcel.Visible=.t.
*Sheets may be visible (-1 or 1), not visible (0) or very hidden xlVeryHidden,2
mWorks = transform(OExcel.Worksheets.Count)
for isheet=1 to OExcel.Worksheets.Count
with OExcel.Worksheets(isheet)
mSheet = oExcel.Worksheets(iSheet).name
mSheetNum = TRANSFORM(iSheet)
.Activate &&&&&&&&&&&&&&&&&&&&&&&&&&&& added
if .Shapes.Count>0
for ia=1 to .Shapes.Count
WITH .Shapes(ia)

IF .type= 8 AND .FormControlType=0 &&msoFormControl and XLButtonControl
.select

mSheetnum = "which is " + transform(isheet) + " of " + mWorks
mCount = TRANSFORM(ia) + " of a total of " + TRANSFORM(oExcel.Worksheets(isheet).Shapes.Count)
mType = transform(.type)
mCaption= transform(oexcel.selection.Characters.Text)
mAction = transform(.OnAction)

wait wind ;
"Worksheet " + mSheet +chr(13)+;
mSheetNum +chr(13)+;
mCount +chr(13)+;
" Type: " + mType +chr(13)+;
" Caption: " + mCaption +chr(13)+;
" onAction: " + mAction

endif
endwith
endfor
endif
endwith
endfor
Previous
Reply
Map
View

Click here to load this message in the networking platform