+ Reply to Thread
Results 1 to 10 of 10

Excel code running too fast?

  1. #1
    Registered User
    Join Date
    12-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Excel code running too fast?

    Hello, it appears I have a sub which may be running too fast. It works properly when using "Step Into". When running the entire sub I receive an error stating the chart has no title, and the line .ChartTitle.Characters.Text gets highlighted yellow. Please see below. Thanks for the help.

    Please Login or Register  to view this content.
    Last edited by etacv; 01-20-2013 at 03:39 PM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Excel code running too fast?

    your code works on my test workbook, attach a sample file for testing
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    01-17-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: Excel code running too fast?

    Have seen this on this forum before , strange thing is this only make's issues in 2007. Everything seems to work fine if you take out ".Characters"

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Excel code running too fast?

    Hello hulpeloos,

    Waarom help met naam soos hulpeloos?

    Your contribution is very much appreciated.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  5. #5
    Registered User
    Join Date
    12-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Excel code running too fast?

    Thanks for the replies. Attaching a workbook.
    Edit: removed attachment.

    Quote Originally Posted by hulpeloos View Post
    Have seen this on this forum before , strange thing is this only make's issues in 2007. Everything seems to work fine if you take out ".Characters"
    Oddly enough it makes it worse for me. Using .Characters it will go through 4-5 iterations of the loop. Without .Characters it will stall on the 2nd. And again, using Step Into through the Debug menu will work fine for the whole loop.
    Last edited by etacv; 01-20-2013 at 03:38 PM.

  6. #6
    Forum Contributor
    Join Date
    01-17-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: Excel code running too fast?

    oh wait now i see something else .... add the red text as indicated below

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Excel code running too fast?

    Interesting. Why the need for that addition?

  8. #8
    Forum Contributor
    Join Date
    01-17-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: Excel code running too fast?

    at bottom of your code you have :
    Please Login or Register  to view this content.
    so before the
    Please Login or Register  to view this content.
    you put
    Please Login or Register  to view this content.

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Excel code running too fast?

    Look at the VBA call of

    DoEvents

    and put a few in your code to allow other things to happen on your machine to slow your code down.
    http://support.microsoft.com/kb/118468
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  10. #10
    Registered User
    Join Date
    12-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Excel code running too fast?

    I understand that. Just trying to determine the justification for adding it. Is that good practice in any code?

    Edit: It did work. Thank you for the help. Does it need the .HasTitle=False before .HasTitle=True because of the loop? So after the first iteration it already thinks it has a title active?

    Thanks!
    Last edited by etacv; 01-20-2013 at 03:36 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1