Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Object doesn't support this property or method error

2 views
Skip to first unread message

Art Barry

unread,
Dec 12, 1997, 3:00:00 AM12/12/97
to

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


Jerry

unread,
Dec 13, 1997, 3:00:00 AM12/13/97
to

This is a shot in the dark, but I recently built an ActiveX control for
use in PowerPoint 8.0 and initially had a lot of trouble. It seemed that
when I first created a control it would work in the container, but as soon
as I added anything to it, it would no longer work properly in the
container.
What I found was that both Word 8 and PowerPoint 8 create their own
files describing the dispatch interface (presumably this speeds up the
loading of control props, methods). These Office apps apparently
build these files when they first 'see' the control. If you change the
dispatch table, you need to delete these files yourself. I don't know
about Excel, but in both Word and PowerPoint there are two files
which should be deleted after you've altered your control. If your
control was named CONTROL.OCX, one of these files is
named CONTROLLib .EXD and can be found in the \windows\temp\ppt8.0
or \windows\temp\word8.0 (or presumably the \windows\temp\excel8.0)
directory. The other file is created in the same directory that your
control
is in, and is named CONTROLLib.TWD. If these files exist on your
machine, try deleting them and re-test your control. The application will
build these files if they don't exist.

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>...

0 new messages