+ Reply to Thread
Results 1 to 2 of 2

VBA that works perfectly in one file errors out in a new file based off the original!

  1. #1
    Registered User
    Join Date
    01-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question VBA that works perfectly in one file errors out in a new file based off the original!

    Morning folks.

    I've got a curious one that has been doing my box in for a few hours now.

    I have some code in an engineering spreadsheet that selects element types from a combobox, and uses the result of that to update the Validation range in another combobox to allow selection of a particular size of element. This - thankfully - is working absolutely perfectly. See below for the original:

    Please Login or Register  to view this content.

    What isn't working for some ungodly reason is the following code, which is merely a cut-down version of the first, with the initial 'IF' statement removed, as there is only the one combobox set to select from:

    Please Login or Register  to view this content.
    The error appears to be in the Range("mrgChordSectionSize").Value = "", which throws up the "Method 'Value' of object 'Range' has failed" error causing Excel to totally crap out.

    Literally all i've done to get from the original (working) file to the new (crashing) file is do a 'Save As...' and delete the 'IF' statement for simplicity, and all hell has broken loose.

    Anyone got any ideas what I might be able to try?

  2. #2
    Registered User
    Join Date
    01-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: VBA that works perfectly in one file errors out in a new file based off the original!

    Never mind - I've solved it. I obviously had a moment of being stupid, because I suddenly realised that by deleting the 'IF' statement, I accidentally removed the section of code that prevents the Sub being called on every cell change rather than just the target cell change, and thus getting a cascading loop from subsequent changes.

    D'oh

+ 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. Delete a file that has just been saved and open original file or vice versa.
    By SHB19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2015, 07:48 AM
  2. Script/macro to save a copy as tab delimited text file and then close original file
    By Merlin803 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2015, 01:34 PM
  3. Delete Rows Based On Empty Cell in Column Works Perfectly For A, but Not J
    By votekinky06 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-27-2014, 05:41 PM
  4. Replies: 3
    Last Post: 11-15-2011, 09:15 AM
  5. Delete a Macro from the Copied File while Replicating the Original File
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-24-2011, 09:50 AM
  6. Replies: 3
    Last Post: 09-08-2005, 03: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