+ Reply to Thread
Results 1 to 2 of 2

Range Value works sometimes stepping though code

Hybrid View

sportsguy Range Value works sometimes... 09-06-2018, 05:23 PM
alansidman Re: Range Value works... 09-06-2018, 05:43 PM
  1. #1
    Registered User
    Join Date
    06-29-2005
    Location
    Boston, MA
    Posts
    56

    Range Value works sometimes stepping though code

    Excel 2010 x32 on Windows 7 x64
    VBA complies fine. References are three ActiveX 6.0, and the usual suspects.

    Beginning of Subroutine

    Sub ImportHC()
    On Error GoTo Err_ImportHC

    Debug.Print Range("DEPT")

    wbOrg = Range("DEPT").Value
    wbOrg = Left(wbOrg, 4)
    Debug.Print wbOrg

    ............ End Sub

    sometimes the Debug.Print Range("DEPT") throws the error "1004 Application-defined or object-defined error"
    sometimes it doesn't.
    sometimes the code works stepping through using F8
    sometimes it doesn't
    Hasn't work in full execution mode.

    What am i missing?


    Thanks in advance
    sportsguy

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,756

    Re: Range Value works sometimes stepping though code

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. [SOLVED] Paste Picture Works When Stepping Through (Debug), But Not In Runtime
    By Hello World in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-04-2017, 01:46 PM
  2. Code works fine when stepping through code but Excel freezes if I run it without stepping
    By OldManExcellor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2016, 10:39 AM
  3. Stepping through code produces different result than running code
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2015, 08:27 AM
  4. Replies: 1
    Last Post: 03-31-2015, 03:01 PM
  5. Open workbook works on stepping but not on execute
    By Wongadob in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-09-2015, 01:33 PM
  6. [SOLVED] Excel-to-eMail Code Works Only When Stepping Through
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2014, 11:19 PM
  7. Code works when stepping through, but cuts out when run
    By Reenen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2005, 07:47 AM

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