+ Reply to Thread
Results 1 to 23 of 23

How to make error handle for mis-typed variable?

Hybrid View

  1. #1
    Vasant Nanavati
    Guest

    Re: How to make error handle for mis-typed variable?

    Hi RBS:

    Can you give an example of the imported sub where the variable is not
    declared publicly, giving rise to a compile error? I'm not sure I completely
    understand the problem. Is strSub a different sub at different times, with
    different sets of variables?

    Regards,

    Vasant




    "RB Smissaert" <bartsmissaert@blueyonder.co.uk> wrote in message
    news:O7$GQJkTFHA.2768@tk2msftngp13.phx.gbl...
    > Do I conclude then that there is just no solution for this?
    >
    > RBS
    >
    > "RB Smissaert" <bartsmissaert@blueyonder.co.uk> wrote in message
    > news:OlThA0$SFHA.2872@TK2MSFTNGP14.phx.gbl...
    > > Have the following situation:
    > > An .xla file will import a Sub from a text file and then run it like

    this:
    > >
    > > Dim strSub as String
    > >
    > > 'some code here to get the Sub imported
    > > Application.Run strSub
    > >
    > > Now it is possible that in this imported Sub are variables that are not
    > > defined publicly, so there
    > > will be a compile error, variable not defined.
    > > As this is not a runtime error I am not sure this error can be handled
    > > gracefully, but I would be interested
    > > in any suggestions how this could be done.
    > >
    > >
    > > RBS
    > >

    >




  2. #2
    Vasant Nanavati
    Guest

    Re: How to make error handle for mis-typed variable?

    RBS:

    OK, got it now. That's a challenge ... I can't quite figure it out at the
    moment. Perhaps, as you said, there is no good solution.

    I guess you're trying to avoid the "Compile error in hidden module" message.
    I'm not sure how you would handle the error much more gracefully than that
    anyway, since your add-in is not going to know the exact nature of the
    error.

    Regards,

    Vasant

    "Vasant Nanavati" <vasantn *AT* aol *DOT* com> wrote in message
    news:%2353DaLmTFHA.3392@TK2MSFTNGP12.phx.gbl...
    > Hi RBS:
    >
    > Can you give an example of the imported sub where the variable is not
    > declared publicly, giving rise to a compile error? I'm not sure I

    completely
    > understand the problem. Is strSub a different sub at different times, with
    > different sets of variables?
    >
    > Regards,
    >
    > Vasant
    >
    >
    >
    >
    > "RB Smissaert" <bartsmissaert@blueyonder.co.uk> wrote in message
    > news:O7$GQJkTFHA.2768@tk2msftngp13.phx.gbl...
    > > Do I conclude then that there is just no solution for this?
    > >
    > > RBS
    > >
    > > "RB Smissaert" <bartsmissaert@blueyonder.co.uk> wrote in message
    > > news:OlThA0$SFHA.2872@TK2MSFTNGP14.phx.gbl...
    > > > Have the following situation:
    > > > An .xla file will import a Sub from a text file and then run it like

    > this:
    > > >
    > > > Dim strSub as String
    > > >
    > > > 'some code here to get the Sub imported
    > > > Application.Run strSub
    > > >
    > > > Now it is possible that in this imported Sub are variables that are

    not
    > > > defined publicly, so there
    > > > will be a compile error, variable not defined.
    > > > As this is not a runtime error I am not sure this error can be handled
    > > > gracefully, but I would be interested
    > > > in any suggestions how this could be done.
    > > >
    > > >
    > > > RBS
    > > >

    > >

    >
    >




  3. #3
    RB Smissaert
    Guest

    Re: How to make error handle for mis-typed variable?

    Maybe the only solution is somehow to check the text before importing it in
    the VBE, but I am not sure that is worth the trouble.

    RBS


    "Vasant Nanavati" <vasantn *AT* aol *DOT* com> wrote in message
    news:ObiSUQmTFHA.2392@TK2MSFTNGP10.phx.gbl...
    > RBS:
    >
    > OK, got it now. That's a challenge ... I can't quite figure it out at the
    > moment. Perhaps, as you said, there is no good solution.
    >
    > I guess you're trying to avoid the "Compile error in hidden module"
    > message.
    > I'm not sure how you would handle the error much more gracefully than that
    > anyway, since your add-in is not going to know the exact nature of the
    > error.
    >
    > Regards,
    >
    > Vasant
    >
    > "Vasant Nanavati" <vasantn *AT* aol *DOT* com> wrote in message
    > news:%2353DaLmTFHA.3392@TK2MSFTNGP12.phx.gbl...
    >> Hi RBS:
    >>
    >> Can you give an example of the imported sub where the variable is not
    >> declared publicly, giving rise to a compile error? I'm not sure I

    > completely
    >> understand the problem. Is strSub a different sub at different times,
    >> with
    >> different sets of variables?
    >>
    >> Regards,
    >>
    >> Vasant
    >>
    >>
    >>
    >>
    >> "RB Smissaert" <bartsmissaert@blueyonder.co.uk> wrote in message
    >> news:O7$GQJkTFHA.2768@tk2msftngp13.phx.gbl...
    >> > Do I conclude then that there is just no solution for this?
    >> >
    >> > RBS
    >> >
    >> > "RB Smissaert" <bartsmissaert@blueyonder.co.uk> wrote in message
    >> > news:OlThA0$SFHA.2872@TK2MSFTNGP14.phx.gbl...
    >> > > Have the following situation:
    >> > > An .xla file will import a Sub from a text file and then run it like

    >> this:
    >> > >
    >> > > Dim strSub as String
    >> > >
    >> > > 'some code here to get the Sub imported
    >> > > Application.Run strSub
    >> > >
    >> > > Now it is possible that in this imported Sub are variables that are

    > not
    >> > > defined publicly, so there
    >> > > will be a compile error, variable not defined.
    >> > > As this is not a runtime error I am not sure this error can be
    >> > > handled
    >> > > gracefully, but I would be interested
    >> > > in any suggestions how this could be done.
    >> > >
    >> > >
    >> > > RBS
    >> > >
    >> >

    >>
    >>

    >
    >



+ 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