+ Reply to Thread
Results 1 to 3 of 3

What to do when a simple code edit will reset your project?

  1. #1
    Registered User
    Join Date
    05-02-2018
    Location
    CT, USA
    MS-Off Ver
    2007/10
    Posts
    23

    What to do when a simple code edit will reset your project?

    There must be a better way then what I am doing. Can someone please explain this to me and let me know if there is a better way?
    When I am in break mode, why does adding a "with" statement below where I’m at need to reset the project? If code flows linearly why would it care if I add something down below?

    And since I’m sure there is a solid reason for this, how should I go about editing code so resetting my project isn’t so painful since I lose all my variables? In other words, when I reset my project, I need to execute the entire script again to have values on my variables, such as dynamic sheet names, to be able to keep testing my code line by line – there must be a better way, right?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: I must be missing something. What to do when a simple edit will reset your project?

    I do not know the technical details of what types of edits require a reset. In particular I don't know why adding a With requires a reset; I would expect it to be evaluated at runtime, and it should be able to deal with adding it below the current execution point.

    However, if you are in development, then you should expect that to make code edits, you must re-run your tests. That isn't particularly painful--You just run the code again. It gets painful if you have a lot of user input that you have to repeat each time, but you haven't mentioned that (and there are ways around it). You can set a breakpoint at the spot where it stopped so you don't have to step line-by-line to that point on the next go-round.

    This is the way it works. In all other programming languages I have used, not only do you have to stop execution to make a code edit, you also need to recompile and rebuild the project and run it again--VBA is the only language I've used that allows you to do hot edits. VBA is quicker when you change code because it is interpreted--you don't have to build it. Count your blessings.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-02-2018
    Location
    CT, USA
    MS-Off Ver
    2007/10
    Posts
    23

    Re: What to do when a simple code edit will reset your project?

    Wow I wouldn't have guessed that. I guess I'll take being able to make some edits over none. Thanks for the reply.

+ 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. VBA- password reset project
    By bebeng07 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2019, 09:23 AM
  2. [SOLVED] monthview error - this action will reset your project, proceed anyway?
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-01-2019, 06:57 AM
  3. VBA Edit WIndow Reset
    By kencoburn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2017, 05:53 AM
  4. [SOLVED] VBA code edit to play wav file - simple answer probably
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2013, 11:09 PM
  5. This Action will Reset your Project
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2011, 06:35 PM
  6. this action will reset your project?
    By e.good in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-27-2011, 12:40 PM
  7. Reset project on open?
    By geoB in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-25-2009, 09:59 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