The Code Cage Forums  



Go Back   The Code Cage Forums > Microsoft Topics > Excel Forum > Excel VBA Programming


Excel VBA Programming Post questions in this forum if they are related to using Microsoft Excel VBA Programming, Macro's etc.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 14th January 2009, 04:05 PM
Forum VIP
MS Office Version: MS Office 2003
MS Office Skill Level: Can use VBA


My Top Tip Count: 0

 
Join Date: Jan 2009
Posts: 37
Thanks to others: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
eggpap is on a distinguished road
Default Code Jumps

I have a wb with many UDFs and sheets, modules, forms etc.
When I use the step by step debug (F8 key), sometimes the step don't jumps to the following statement of the routine but to some statement of a UDF. I'ld like to know if this is a correct behaviour or it's a sign of some defects hidden in the procedure.

Apart these jumps that I see only debugging, apparently the procedure performs correctly. I'ld like, however, to know if these jumps must (or can) be avoided. I thought, for example, to place a pair of Application.EnableEvents (False/True) at the beginning and at the end of every routine/function, but I am not sure.

Thanks,
Emiliano
__________________
Emiliano
Excel 2003 on Vista HP System - can use VBA
Reply With Quote


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement
  #2 (permalink)  
Old 14th January 2009, 04:43 PM
Kassie
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default RE: Code Jumps

Not knowing your code makes it impossible to answer! It might just be that
your code actually calls the UDF?
--
Hth

Kassie Kasselman
Change xxx to hotmail


"eggpap" wrote:

>
> I have a wb with many UDFs and sheets, modules, forms etc.
> When I use the step by step debug (F8 key), sometimes the step don't
> jumps to the following statement of the routine but to some statement of
> a UDF. I'ld like to know if this is a correct behaviour or it's a sign
> of some defects hidden in the procedure.
>
> Apart these jumps that I see only debugging, apparently the procedure
> performs correctly. I'ld like, however, to know if these jumps must (or
> can) be avoided. I thought, for example, to place a pair of
> Application.EnableEvents (False/True) at the beginning and at the end of
> every routine/function, but I am not sure.
>
> Thanks,
> Emiliano
>
>
> --
> eggpap
>
> Excel 2003 on Vista HP System - can use VBA
> ------------------------------------------------------------------------
> eggpap's Profile: http://www.thecodecage.com/forumz/members/eggpap.html
> View this thread: Code Jumps
>
>

Reply With Quote


Did you find this post helpful? Yes | No
  #3 (permalink)  
Old 14th January 2009, 04:59 PM
Forum VIP
MS Office Version: MS Office 2003
MS Office Skill Level: Can use VBA


My Top Tip Count: 0

 
Join Date: Jan 2009
Posts: 37
Thanks to others: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
eggpap is on a distinguished road
Default Re: Code Jumps

Thanks for your reply,

Quote:
Originally Posted by Kassie View Post
Not knowing your code makes it impossible to answer! It might just be that
your code actually calls the UDF?
No, the UDFs are called by Excel itself not by code.
I think you can reply without seeing the code, that is very big. I ask only if you, thanks to the experience I don't have, have ever seen a similar behaviour.

Emiliano
__________________
Emiliano
Excel 2003 on Vista HP System - can use VBA
Reply With Quote


Did you find this post helpful? Yes | No
  #4 (permalink)  
Old 14th January 2009, 05:25 PM
Simon Lloyd's Avatar
Administrator
MS Office Version: MS Office 97, 2003, 2007
MS Office Skill Level: Can use most of MS Office


My Top Tip Count: 6

 
Join Date: Aug 2008
Location: Manchester, England
Age: 44
Posts: 765
Thanks to others: 3
Thanked 15 Times in 14 Posts
Rep Power: 10
Simon Lloyd has a spectacular aura aboutSimon Lloyd has a spectacular aura aboutSimon Lloyd has a spectacular aura about
6 Top Tips
Wales
Default Re: Code Jumps

Emiliano, attach a workbook so we can see whats going on and help you further!

Attatchments.
Information

Information


To upload a workbook, click reply then add your few words, scroll down past the submit button and you will see the Manage Attatchments button, this is where you get to add files for upload, if you have any trouble please use this Contact Us link or the one at the bottom of the any page.





Quote:
Originally Posted by eggpap
Thanks for your reply,


Quote:
Originally Posted by Kassie
Not knowing your code makes it impossible to answer! It might just be that
your code actually calls the UDF?

No, the UDFs are called by Excel itself not by code.
I think you can reply without seeing the code, that is very big. I ask only if you, thanks to the experience I don't have, have ever seen a similar behaviour.

Emiliano
__________________
Regards,
Simon Lloyd
The Code Cage
Reply With Quote


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement
  #5 (permalink)  
Old 14th January 2009, 06:06 PM
Forum VIP
MS Office Version: MS Office 2003
MS Office Skill Level: Can use VBA


My Top Tip Count: 0

 
Join Date: Jan 2009
Posts: 37
Thanks to others: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
eggpap is on a distinguished road
Default Re: Code Jumps

Thanks,

my wb links to many mdb files. To get it correctly perfoming you need all the files installed on a test folder named as you like. Moreover, I use Excel 2003 Italian version, probably you'll have some problem of function convertion.

Emiliano
__________________
Emiliano
Excel 2003 on Vista HP System - can use VBA
Reply With Quote


Did you find this post helpful? Yes | No
  #6 (permalink)  
Old 14th January 2009, 07:40 PM
Jim Thomlinson
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Default Re: Code Jumps

As a guess you are using the UDF within your workbook somewhere. While your
code is executing a change is made to your workbook which forces a
calculation. When the calculation runs your UDF gets called as the cell the
udf is in has been dirtied by some sort of action of the UDF has been defined
as Volatile...

--
HTH...

Jim Thomlinson


"eggpap" wrote:

>
> Thanks,
>
> my wb links to many mdb files. To get it correctly perfoming you need
> all the files installed on a test folder named as you like. Moreover, I
> use Excel 2003 Italian version, probably you'll have some problem of
> function convertion.
>
> Emiliano
>
>
> +-------------------------------------------------------------------+
> |Filename: CCtest.zip |
> |Download: http://www.thecodecage.com/forumz/at...tachmentid=63|
> +-------------------------------------------------------------------+
>
> --
> eggpap
>
> Excel 2003 on Vista HP System - can use VBA
> ------------------------------------------------------------------------
> eggpap's Profile: http://www.thecodecage.com/forumz/members/eggpap.html
> View this thread: Code Jumps
>
>

Reply With Quote


Did you find this post helpful? Yes | No
  #7 (permalink)  
Old 14th January 2009, 07:53 PM
Forum VIP
MS Office Version: MS Office 2003
MS Office Skill Level: Can use VBA


My Top Tip Count: 0

 
Join Date: Jan 2009
Posts: 37
Thanks to others: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
eggpap is on a distinguished road
Default Re: Code Jumps

Quote:
When the calculation runs your UDF gets called as the cell the
udf is in has been dirtied by some sort of action of the UDF has been defined
as Volatile...
I think, but I'm not sure for my bad english, that this is an anormal situation. How to define Volatile an UDF action? May I find more information on this? Have you seen my workbook?

Thanks, Emiliano
__________________
Emiliano
Excel 2003 on Vista HP System - can use VBA
Reply With Quote


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement
  #8 (permalink)  
Old 14th January 2009, 08:35 PM
Simon Lloyd's Avatar
Administrator
MS Office Version: MS Office 97, 2003, 2007
MS Office Skill Level: Can use most of MS Office


My Top Tip Count: 6

 
Join Date: Aug 2008
Location: Manchester, England
Age: 44
Posts: 765
Thanks to others: 3
Thanked 15 Times in 14 Posts
Rep Power: 10
Simon Lloyd has a spectacular aura aboutSimon Lloyd has a spectacular aura aboutSimon Lloyd has a spectacular aura about
6 Top Tips
Wales
Default Re: Code Jumps

I had asked someone Italian to look at your workbook to help, however your VBA Project is password protected so they couldn't view your code!

Quote:
Originally Posted by eggpap View Post
I think, but I'm not sure for my bad english, that this is an anormal situation. How to define Volatile an UDF action? May I find more information on this? Have you seen my workbook?

Thanks, Emiliano
__________________
Regards,
Simon Lloyd
The Code Cage
Reply With Quote


Did you find this post helpful? Yes | No
  #9 (permalink)  
Old 25th January 2009, 01:12 PM
Forum VIP
MS Office Version: MS Office 2003
MS Office Skill Level: Can use VBA


My Top Tip Count: 0

 
Join Date: Jan 2009
Posts: 37
Thanks to others: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
eggpap is on a distinguished road
Default Re: Code Jumps

Thanks to all,

I have solved my issue.
__________________
Emiliano
Excel 2003 on Vista HP System - can use VBA
Reply With Quote


Did you find this post helpful? Yes | No
  #10 (permalink)  
Old 25th January 2009, 01:22 PM
Simon Lloyd's Avatar
Administrator
MS Office Version: MS Office 97, 2003, 2007
MS Office Skill Level: Can use most of MS Office


My Top Tip Count: 6

 
Join Date: Aug 2008
Location: Manchester, England
Age: 44
Posts: 765
Thanks to others: 3
Thanked 15 Times in 14 Posts
Rep Power: 10
Simon Lloyd has a spectacular aura aboutSimon Lloyd has a spectacular aura aboutSimon Lloyd has a spectacular aura about
6 Top Tips
Wales
Default Re: Code Jumps

eggpap, we're glad you have it solved, why not share the method by which you solved it, it may help others in the future!

Once you have finished with this thread
Help

Help

If your query has been solved please take a moment to let us and eveyone else know by going to, Thread Tools > "Mark This Thread As Solved", shown by this icon



__________________
Regards,
Simon Lloyd
The Code Cage
Reply With Quote


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement
Reply

Bookmarks

Tags
code, jumps

New topics in Excel VBA Programming


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code jumps to WS_Calculate on a different sheet JMay Excel VBA Programming 4 3rd June 2009 06:30 PM
cursor jumps around JES Outlook Functions 0 8th February 2009 05:03 PM
cursor jumps around page mdv1952 Outlook Functions 2 30th October 2008 09:25 PM
OE jumps to the top!! How do I stop that? effdee Outlook Functions 3 30th October 2008 07:33 AM
On save excel jumps to another worksheet. How to fix VBA code? BillJenk Excel VBA Programming 2 9th October 2008 10:30 PM

The Code Cage Affilliates




All times are GMT +1. The time now is 09:50 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 RC2
No part of this board may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!