Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling procedure from a sheet in Excel 1

Status
Not open for further replies.

mtroche

Civil/Environmental
Jun 4, 2001
39
0
0
PR
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!!
 
Replies continue below

Recommended for you

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.
 
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.
 
Status
Not open for further replies.
Back
Top