Sub works sometimes and sometimes doesn't
Peter,
Interfaces are generally created PublicNotCreateable as they cannot be
created in and of themselves but must be implemented by another class that
can be created. For the same reason the Sub Initialise has no implementation
because the implementation is in certain worksheets (which are objects)
within my workbook. It is almost unimportant what is in the implementation
because the worksheet is not behaving as if it implements the interface (by
use of Implements ICustomSheet at the top of the worksheets class module).
That, along with the inconsistent behaviour of the code dependent on whether
it is being run or stepped through, is the problem. I guess I am asking why
this is behaving so inconsistently and is there any reason why I cannot
implement a custom interface in a worksheet in excel?
""Peter Huang" [MSFT]" wrote:
Hi Barry,
Based on my MSDN document,
PublicNotCreatable. Other applications can use objects of this class only
if your component creates the objects first. Other applications cannot use
the CreateObject function or the New operator to create objects from the
class.
So I suggest you may try to use 1- Private.
Also did the problem reproduce if we use the code below only.
Option Explicit
Public Sub Initialise() 'UK Spelling
End Sub
That is to say, we did not nothing in the Initialise function.
If you still have any concern, please feel free to post here.
Thanks!
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
|