×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Calling procedure from a sheet in Excel

Calling procedure from a sheet in Excel

Calling procedure from a sheet in Excel

(OP)
I am calling a procedure called TRET from an UserForm.  TRET is located in sheet6.  Here is part of my code:

If A=1 then
    sheet6.TRET
else
    call SUGAR
end if

The problem is that I can't call TRET from sheet6!!  It says that there is a "Type mismatch".  What I am doing wrong!!

RE: Calling procedure from a sheet in Excel

I've noticed a wierd behavior in the debug tool when calling subroutines within sheets.  An error will occur within the subroutine, but the debug tool will highlight the original call to the subroutine rather than the offending line (and each time you hit "play" it will restart the subroutine and go through all the steps leading up to the error over again).  The next time you run and get the error, pick "debug," then use F8 to step through the subroutine line-by-line until you find the error.  You could also set stops within the subroutine and hit f5 to jump from one to the next until the error shows up.

Chances are you've got a string that you're trying to stuff into an integer somewhere inside that subroutine TRET.

RE: Calling procedure from a sheet in Excel

(OP)
Thanks for ypur reply, ivymike.  You are right!  The problem was inside the TRET procedure not in how I am calling it.  

Thanks again for your help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources