+ Reply to Thread
Results 1 to 3 of 3

Problems Setting properties of class module

  1. #1
    Andibevan
    Guest

    Problems Setting properties of class module

    Hi All,

    I have a class module called DosOutputs. Here is one of the properties:-

    Public Property Let CommandLine(DOSCommand As String)
    mCommand = DOSCommand
    End Property

    I get the error "invalid use of property" when I try to set this property as
    follows:-

    objDOS.CommandLine = txtCommand.Text

    What am I doing wrong?

    Ta

    Andi




  2. #2
    Jim Thomlinson
    Guest

    RE: Problems Setting properties of class module

    There has to be more to it than what we are seeing. I created the exact same
    code at my end and it works fine. How is m_Command declared? String, Integer,
    ???

    Try changing
    objDOS.CommandLine = txtCommand.Text
    To
    objDOS.CommandLine = "Test"
    Just to see if that helps...
    --
    HTH...

    Jim Thomlinson


    "Andibevan" wrote:

    > Hi All,
    >
    > I have a class module called DosOutputs. Here is one of the properties:-
    >
    > Public Property Let CommandLine(DOSCommand As String)
    > mCommand = DOSCommand
    > End Property
    >
    > I get the error "invalid use of property" when I try to set this property as
    > follows:-
    >
    > objDOS.CommandLine = txtCommand.Text
    >
    > What am I doing wrong?
    >
    > Ta
    >
    > Andi
    >
    >
    >
    >


  3. #3
    Andibevan
    Guest

    Re: Problems Setting properties of class module

    Your completely right - I managed to work it out on the train home - I had
    missed a declaration out - thanks again for your suggestions.

    Do you know of any good guides to class modules? I have another problem
    with custom events and Raiseevent but I want to do some reading before I
    post lots of questions..

    Thanks again

    Andi

    "Jim Thomlinson" <[email protected]> wrote in message
    news:[email protected]...
    > There has to be more to it than what we are seeing. I created the exact

    same
    > code at my end and it works fine. How is m_Command declared? String,

    Integer,
    > ???
    >
    > Try changing
    > objDOS.CommandLine = txtCommand.Text
    > To
    > objDOS.CommandLine = "Test"
    > Just to see if that helps...
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Andibevan" wrote:
    >
    > > Hi All,
    > >
    > > I have a class module called DosOutputs. Here is one of the

    properties:-
    > >
    > > Public Property Let CommandLine(DOSCommand As String)
    > > mCommand = DOSCommand
    > > End Property
    > >
    > > I get the error "invalid use of property" when I try to set this

    property as
    > > follows:-
    > >
    > > objDOS.CommandLine = txtCommand.Text
    > >
    > > What am I doing wrong?
    > >
    > > Ta
    > >
    > > Andi
    > >
    > >
    > >
    > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1