I trying to develop an ActiveX control that can be inserted into an Excel
worksheet with the MFC Application Wizard.
So far I can insert the object into the spreadsheet but having problems
with accessing its methods. I've named the
inserted object "AbsEncoder". The indicated line of code generates an
error "Object doesn't support this property or method".
I've included the tlb generated by MFC into the reference list in Excel and
when I activate Excel's Object browser, the methods
show up in the list but I did notice that it does not show the return type.
Sub DisplayCurrentPosition()
Dim encoder As OLEObject
Dim position As Single
Set encoder = Worksheets("Sheet1").OLEObjects("AbsEncoder")
position = encoder.GetPositionDegrees 'get error on this call
Worksheets("Sheet1").Range("A1").Value = "Position"
Worksheets("Sheet1").Range("A2").Value = position
End Sub
Any help would be appreciated.
E-mail address - artb...@sprynet.com
If you're writing for a version of Excel prior to Office 97, this probably
won't help. If this is for Office 97, it will probably help. There is a
document
in the Microsoft knowledge base on this issue, which I found about 3 weeks
AFTER spending about a week solving this stupid problem. Hope this
helps ..
Jerry
Art Barry <artb...@sprynet.com> wrote in article
<01bd0744$540f47a0$72c3aec7@art>...