+ Reply to Thread
Results 1 to 7 of 7

Compile error in hidden module

  1. #1
    Registered User
    Join Date
    05-04-2005
    Location
    Papamoa, New Zealand
    MS-Off Ver
    Office 365
    Posts
    56

    Compile error in hidden module

    Hi,

    I have password protected my excel macros and thus they are hidden from others that use it.

    However when there is a 'compile error' I automaticly receive an error message
    "Compile error in hidden module:Module1".

    Is there any way that I can change that error message to read something like this :-

    "Complile error - contact Bernz and advise exactly what you were doing at the time of the error message"

    Cheers,
    Bernz

  2. #2
    Dave Peterson
    Guest

    Re: Compile error in hidden module

    I don't think you can intercept this message and make it do what you want.

    In fact, I don't think you can do much with a compile error.

    But you could compile your project before you release it to others.

    Inside the VBE
    Debug|Compile VBAProject




    BernzG wrote:
    >
    > Hi,
    >
    > I have password protected my excel macros and thus they are hidden from
    > others that use it.
    >
    > However when there is a 'compile error' I automaticly receive an error
    > message
    > "Compile error in hidden module:Module1".
    >
    > Is there any way that I can change that error message to read something
    > like this :-
    >
    > "Complile error - contact Bernz and advise exactly what you were doing
    > at the time of the error message"
    >
    > Cheers,
    > Bernz
    >
    > --
    > BernzG
    > ------------------------------------------------------------------------
    > BernzG's Profile: http://www.excelforum.com/member.php...o&userid=22949
    > View this thread: http://www.excelforum.com/showthread...hreadid=388193


    --

    Dave Peterson

  3. #3
    keepITcool
    Guest

    Re: Compile error in hidden module

    recipient may still get the compile errors.
    if he has a different excel version, or missing references to activex
    objects/libraries)




    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    Dave Peterson wrote :

    > I don't think you can intercept this message and make it do what you
    > want.
    >
    > In fact, I don't think you can do much with a compile error.
    >
    > But you could compile your project before you release it to others.
    >
    > Inside the VBE
    > Debug|Compile VBAProject
    >


  4. #4
    Dave Peterson
    Guest

    Re: Compile error in hidden module

    Good point.

    keepITcool wrote:
    >
    > recipient may still get the compile errors.
    > if he has a different excel version, or missing references to activex
    > objects/libraries)
    >
    > --
    > keepITcool
    > | www.XLsupport.com | keepITcool chello nl | amsterdam
    >
    > Dave Peterson wrote :
    >
    > > I don't think you can intercept this message and make it do what you
    > > want.
    > >
    > > In fact, I don't think you can do much with a compile error.
    > >
    > > But you could compile your project before you release it to others.
    > >
    > > Inside the VBE
    > > Debug|Compile VBAProject
    > >


    --

    Dave Peterson

  5. #5
    Registered User
    Join Date
    05-04-2005
    Location
    Papamoa, New Zealand
    MS-Off Ver
    Office 365
    Posts
    56

    Runtime error in hidden module

    Hi,

    Thanks for this.

    Yes compile errors should be picked up in the first place when creating and testing the macro - should have realised that.

    I got it wrong in that I was wanting the intercept and replace a "runtime" error message when a user does something that I have not thought of or tested for.

    Example of the error message:-

    "Microsoft Visual Basic
    Run time error ###########
    Automation error
    The error invoked has been disconnected from its clients"

    Also exited completely out of Excel - stating reporting error

    Can this message be replaced with my own message as stated previously.

    Cheers,
    Bernz
    Last edited by BernzG; 07-19-2005 at 03:16 AM.

  6. #6
    Dave Peterson
    Guest

    Re: Compile error in hidden module

    You could add some error handling to each sub:

    option explicit
    sub mysub()

    on error goto errhandler:

    'do lots of stuff

    exit sub

    errhandler:
    msgbox err.number & vblf & err.description

    end sub



    BernzG wrote:
    >
    > Hi,
    >
    > Thanks for this.
    >
    > Yes compile errors should be picked up in the first place when creating
    > and testing the macro - should have realised that.
    >
    > I got it wrong in that I was wanting the intercept and replace a
    > "runtime" error message when a user does something that I have not
    > thought of or tested for.
    >
    > Example of the error message:-
    >
    > "Microsoft Visual Basic
    > Run time error ###########
    > Automation error
    > The error invoked has been disconnected from its clients"
    >
    > Also exited completely out of Excel - stating reporting error
    >
    > Can this message be replaced with my own message as stated previously.
    >
    > Cheers,
    > Bernz
    >
    > --
    > BernzG
    > ------------------------------------------------------------------------
    > BernzG's Profile: http://www.excelforum.com/member.php...o&userid=22949
    > View this thread: http://www.excelforum.com/showthread...hreadid=388193


    --

    Dave Peterson

  7. #7
    Registered User
    Join Date
    05-04-2005
    Location
    Papamoa, New Zealand
    MS-Off Ver
    Office 365
    Posts
    56

    Runtime error in hidden module

    Thanks Dave.

+ 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