• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Can't call procedure in Immediate Pane

PipBoy808

Member
I have the following code:

Code:
Sub Testloop()
Dim intcounter As Integer
 
For intcounter = 1 To 5
    Debug.Print intcounter
    Next intcounter
End Sub

Usually, when I type 'testloop' in the immediate pane, it runs the procedure and displays the numbers 1 to 5 as it should. Other times, I get the message:

"Compile error:

Expected procedure, not variable"

I have no idea what I have done that makes it possible for me to call the procedure one minute and then brings an error the next minute. Does anyone have any ideas?

EDIT: I should point out that pressing F5 runs the procedure as normal. I just can't seem to get it going from the Immediate Pane.
 
Hi

I just tried running the above code for couple of times, it is working fine in my system. I don't see any issues calling procedure from Immediate window.
 
It's the weirdest thing. It was working, and now it isn't. At least it's only a test procedure and nothing important.
 
Back
Top