General information
Category:
COM/DCOM and OLE Automation
Hi, I am trying to search for a particular caption name of a button in an Excel spread sheet.
However, when, I use the following great code -- taken from this thread -- ,
everything but the caption changes, as the program executes? Is there a way to get to
the individual captions. I have tried Intellisense but got no further
Thanks
Steve
OExcel= GetOBJECT(, "Excel.Application")
OExcel.Visible=.t.
for isheet=1 to OExcel.Worksheets.Count
with OExcel.Worksheets(isheet)
if .Shapes.Count>0
for ia=1 to .Shapes.Count
WITH .Shapes(ia)
IF .type= 8 AND .FormControlType=0 &&msoFormControl and XLButtonControl
.select
mSheet = oExcel.Worksheets(isheet).name
mCount = TRANSFORM(ia) + " of a total of " + TRANSFORM(oExcel.Worksheets(isheet).Shapes.Count)
mType = transform(.type)
&& can also be mCaption= transform(oexcel.selection)
mCaption= transform(oexcel.selection.Characters.Text)
mAction = transform(.OnAction)
wait WINDOW ;
" Worksheet " + mSheet +chr(13)+; && works changes with each iterations
mCount +chr(13)+; && works
" Type: " + mType +chr(13)+; && works
" Caption: " + mCaption +chr(13)+; && caption always the same ??
" onAction: " + mAction && works
endif
endwith
endfor
endif
endwith
endfor
endif
Previous
Next
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