Seamus2626
asked on
Stepping through like F5
Hi guys,
I have some code below, i like to step through bit by bit to test.
When i press F8 on the below code, it is running striaght through it, how/why is this?! I am not using F5, its F8....
Any help would be appreciated!
Thanks
I have some code below, i like to step through bit by bit to test.
When i press F8 on the below code, it is running striaght through it, how/why is this?! I am not using F5, its F8....
Any help would be appreciated!
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You didn't actually show the code so why don't you do that now.
ASKER
Sorry Martin
Sub DoingTheWork()
Workbooks.Open Filename:= _
"A:\Horis Info\ME_denniss_Project\wh ynee Downloads\CurrentMonth.xls x"
Sheets("Incountry").Select
Cells.Select
With Selection
.WrapText = False
.MergeCells = False
End With
Sub DoingTheWork()
Workbooks.Open Filename:= _
"A:\Horis Info\ME_denniss_Project\wh
Sheets("Incountry").Select
Cells.Select
With Selection
.WrapText = False
.MergeCells = False
End With
OK I don't see anything unusual so why don't you try putting a breakpoint at the Workbooks.Open line.
Or just put your cursor somewhere in the sub and press F8.
ASKER
I can work around it by putting the breakpoint in at sheets, but i want to know its runnning through the code without my permission!!
Sorry but I'm not sure what you mean. Can you list, step by step, what you are doing and what you expect to happen?
ASKER
So, i expect to go into the sub and press F8, then i expect the cursor to move through the first line of code, then when i press F8 again, i expect it to move through the next, and so on, i dont want it to run through the entire script as if i was pressing F5
Thanks
Thanks
I guess I don't know why it's doing that. Do you perhaps have f8 assigned to something else? What happens if you press the "Step into" menu item?
Exactly what part of the code is this happening on?
Also, how is the code being run/triggered?
Also, how is the code being run/triggered?
ASKER
So, F8 works fine for stepping through all my code, its just when i have the code
Workbooks.Open Filename:= _
"A:\Horis Info\ME_denniss_Project\wh ynee Downloads\CurrentMonth.xls x"
Thats the problem, when im opening a file, it triggers the code off to run through the rest off the sub
If my sub was
Sub test
Msgbox "hello"
Msbox "hello"
[A1].slect
End sub
F8 would step through each line perfectly
Workbooks.Open Filename:= _
"A:\Horis Info\ME_denniss_Project\wh
Thats the problem, when im opening a file, it triggers the code off to run through the rest off the sub
If my sub was
Sub test
Msgbox "hello"
Msbox "hello"
[A1].slect
End sub
F8 would step through each line perfectly
Probably because the other workbook becomes active.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the info guys!
You're welcome and I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
ASKER