+ Reply to Thread
Results 1 to 5 of 5

Excel Crashing without Error when running macro

  1. #1
    Registered User
    Join Date
    01-21-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Question Excel Crashing without Error when running macro

    Hi there,

    I have created a Macro that does the following:
    - Takes 20 cells (which contain headings) and stores them in an Array
    - Looks into a network folder and lists 50 Excel files into an Array
    - It then loops through each file, while in each file is finds each column heading and copies a set number of records to a new sheet.
    - Once all 20 headings have been copied (and data below them) it goes to the next file until all 50 files are complete

    After every time I copy, I reset the Clipboard.

    Sometimes half way through the macro, it simply crashes with no error report. Sometimes it completes without any issues. I can adjust the columns it copies and when I do less it fails less and sometimes never. The more columns I add the more unstable it gets.

    Is there a stack that's getting to big that I can reset? Obviously doing one sheet is no problem with lot's of rows...so if there was a way to break and reset I feel I would eliminate Excel crashing.

    I have a variable that increments by the amount of copied rows (so it knows where to paste in the new sheet) that is a running total. So I can simply reset the whole macro every book very easily.

    Thanks,
    Robb

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel Crashing without Error when running macro

    Hi Robbeh,

    If you'll post your code, we can, maybe, deduce what's happening or, at least suggest an alternate approach
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    01-21-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Excel Crashing without Error when running macro

    Absolutely, I probably should have done that right away. I am no expert but I am learning so don't be too critical.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel Crashing without Error when running macro

    As I peruse your code, I see that you've declared all your indices as Integer - try changing them to Long and I'll continue analyzing the code.

    But, that might fix it

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel Crashing without Error when running macro

    Well - I've made it more readable for me, but I don't know that I fixed anything

    Please Login or Register  to view this content.

+ 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 crashing when trying to view code before macro run; not crashing after first run
    By goonerforlyf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2015, 05:27 PM
  2. Excel 2010 crashing when running macros....my code?
    By dietcoke802 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2013, 05:56 PM
  3. Excel 2010 keeps crashing when running a specific macro.
    By bean29 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2013, 07:36 AM
  4. Excel macro to get outlook contact info (runtime error/crashing)
    By ZTHawk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-19-2012, 04:19 AM
  5. Replies: 2
    Last Post: 11-26-2012, 08:33 AM
  6. Automation Error Crashing Excel
    By jwnwrestler171 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2012, 11:40 AM
  7. Microsoft Excel crashing error - PLEASE HELP!!!
    By NetAdmin in forum Excel General
    Replies: 0
    Last Post: 08-07-2006, 01:45 PM

Tags for this Thread

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