+ Reply to Thread
Results 1 to 7 of 7

Excel hangs when getting text from cell

  1. #1
    Registered User
    Join Date
    08-16-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    3

    Excel hangs when getting text from cell

    Hello - if I read integers from cells using, for example, myInteger = Cells(5, "C).Value, my code runs fine.....

    ....if I try to read in a string, using myString = Cells(5, "D).Value, Excel hangs every time!!?!?!?

    Why does it work ok for integers but hangs for strings??

    Any help greatly appreciated.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,168

    Re: Excel hangs when getting text from cell

    Surely .... you mean Cells(5, "C").Value
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    08-16-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    3

    Re: Excel hangs when getting text from cell

    Yep! (Typo)

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,168

    Re: Excel hangs when getting text from cell

    K, let me try this again...
    Hallo DarkAnima

    Welcome to the Forum. We can surely solve this mystery....
    How bout uploading a sample file so that we can see what we are working with...
    i assume it has to do with .value and .text

  5. #5
    Registered User
    Join Date
    08-16-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    3

    Re: Excel hangs when getting text from cell

    Here is my code that runs when the user presses the "Save" button - the line that is commented out causes Excel to hang for 4-5 seconds when uncommented!? The only difference between that Cells call and the other is that it's text not a number!!

    Please Login or Register  to view this content.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,168

    Re: Excel hangs when getting text from cell

    Try changing this...
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    @ Winon...
    Wat se jy maaitjie....Kan miskien verkeerd wees.
    Last edited by sintek; 08-16-2017 at 11:17 AM.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Excel hangs when getting text from cell

    DarkAnima

    Don't use text property, unless you really need to use it.
    It will slow down the process and if the cell shows like #######, it will pick it as it is.

    What is in Cells(5, "C")?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Hangs
    By Cleveland_Steve in forum Microsoft Windows Help
    Replies: 10
    Last Post: 08-14-2012, 04:40 PM
  2. Excel hangs on DDE
    By zlackoff in forum Excel General
    Replies: 2
    Last Post: 07-12-2011, 09:39 AM
  3. Excel 2007 : Excel hangs up
    By JuliusStSwithin in forum Excel General
    Replies: 0
    Last Post: 03-10-2011, 10:23 AM
  4. Replies: 2
    Last Post: 09-22-2010, 07:54 PM
  5. Excel hangs...
    By coder_arun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2006, 09:00 AM
  6. Excel hangs up.
    By bc in forum Excel General
    Replies: 0
    Last Post: 02-28-2006, 02:35 PM
  7. Excel hangs
    By Oxns in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-24-2006, 01:35 AM
  8. Excel Hangs
    By Linda in forum Excel General
    Replies: 2
    Last Post: 10-04-2005, 12:05 PM

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